57 #ifndef PY_SSIZE_T_CLEAN
58 #define PY_SSIZE_T_CLEAN
62 #error Python headers needed to compile C extensions, please install development version of Python.
63 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
64 #error Cython requires Python 2.6+ or Python 3.3+.
66 #define CYTHON_ABI "0_29_24"
67 #define CYTHON_HEX_VERSION 0x001D18F0
68 #define CYTHON_FUTURE_DIVISION 1
71 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
73 #if !defined(WIN32) && !defined(MS_WINDOWS)
85 #define DL_IMPORT(t) t
88 #define DL_EXPORT(t) t
91 #ifndef HAVE_LONG_LONG
92 #if PY_VERSION_HEX >= 0x02070000
93 #define HAVE_LONG_LONG
97 #define PY_LONG_LONG LONG_LONG
100 #define Py_HUGE_VAL HUGE_VAL
103 #define CYTHON_COMPILING_IN_PYPY 1
104 #define CYTHON_COMPILING_IN_PYSTON 0
105 #define CYTHON_COMPILING_IN_CPYTHON 0
106 #undef CYTHON_USE_TYPE_SLOTS
107 #define CYTHON_USE_TYPE_SLOTS 0
108 #undef CYTHON_USE_PYTYPE_LOOKUP
109 #define CYTHON_USE_PYTYPE_LOOKUP 0
110 #if PY_VERSION_HEX < 0x03050000
111 #undef CYTHON_USE_ASYNC_SLOTS
112 #define CYTHON_USE_ASYNC_SLOTS 0
113 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
114 #define CYTHON_USE_ASYNC_SLOTS 1
116 #undef CYTHON_USE_PYLIST_INTERNALS
117 #define CYTHON_USE_PYLIST_INTERNALS 0
118 #undef CYTHON_USE_UNICODE_INTERNALS
119 #define CYTHON_USE_UNICODE_INTERNALS 0
120 #undef CYTHON_USE_UNICODE_WRITER
121 #define CYTHON_USE_UNICODE_WRITER 0
122 #undef CYTHON_USE_PYLONG_INTERNALS
123 #define CYTHON_USE_PYLONG_INTERNALS 0
124 #undef CYTHON_AVOID_BORROWED_REFS
125 #define CYTHON_AVOID_BORROWED_REFS 1
126 #undef CYTHON_ASSUME_SAFE_MACROS
127 #define CYTHON_ASSUME_SAFE_MACROS 0
128 #undef CYTHON_UNPACK_METHODS
129 #define CYTHON_UNPACK_METHODS 0
130 #undef CYTHON_FAST_THREAD_STATE
131 #define CYTHON_FAST_THREAD_STATE 0
132 #undef CYTHON_FAST_PYCALL
133 #define CYTHON_FAST_PYCALL 0
134 #undef CYTHON_PEP489_MULTI_PHASE_INIT
135 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
136 #undef CYTHON_USE_TP_FINALIZE
137 #define CYTHON_USE_TP_FINALIZE 0
138 #undef CYTHON_USE_DICT_VERSIONS
139 #define CYTHON_USE_DICT_VERSIONS 0
140 #undef CYTHON_USE_EXC_INFO_STACK
141 #define CYTHON_USE_EXC_INFO_STACK 0
142 #elif defined(PYSTON_VERSION)
143 #define CYTHON_COMPILING_IN_PYPY 0
144 #define CYTHON_COMPILING_IN_PYSTON 1
145 #define CYTHON_COMPILING_IN_CPYTHON 0
146 #ifndef CYTHON_USE_TYPE_SLOTS
147 #define CYTHON_USE_TYPE_SLOTS 1
149 #undef CYTHON_USE_PYTYPE_LOOKUP
150 #define CYTHON_USE_PYTYPE_LOOKUP 0
151 #undef CYTHON_USE_ASYNC_SLOTS
152 #define CYTHON_USE_ASYNC_SLOTS 0
153 #undef CYTHON_USE_PYLIST_INTERNALS
154 #define CYTHON_USE_PYLIST_INTERNALS 0
155 #ifndef CYTHON_USE_UNICODE_INTERNALS
156 #define CYTHON_USE_UNICODE_INTERNALS 1
158 #undef CYTHON_USE_UNICODE_WRITER
159 #define CYTHON_USE_UNICODE_WRITER 0
160 #undef CYTHON_USE_PYLONG_INTERNALS
161 #define CYTHON_USE_PYLONG_INTERNALS 0
162 #ifndef CYTHON_AVOID_BORROWED_REFS
163 #define CYTHON_AVOID_BORROWED_REFS 0
165 #ifndef CYTHON_ASSUME_SAFE_MACROS
166 #define CYTHON_ASSUME_SAFE_MACROS 1
168 #ifndef CYTHON_UNPACK_METHODS
169 #define CYTHON_UNPACK_METHODS 1
171 #undef CYTHON_FAST_THREAD_STATE
172 #define CYTHON_FAST_THREAD_STATE 0
173 #undef CYTHON_FAST_PYCALL
174 #define CYTHON_FAST_PYCALL 0
175 #undef CYTHON_PEP489_MULTI_PHASE_INIT
176 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
177 #undef CYTHON_USE_TP_FINALIZE
178 #define CYTHON_USE_TP_FINALIZE 0
179 #undef CYTHON_USE_DICT_VERSIONS
180 #define CYTHON_USE_DICT_VERSIONS 0
181 #undef CYTHON_USE_EXC_INFO_STACK
182 #define CYTHON_USE_EXC_INFO_STACK 0
184 #define CYTHON_COMPILING_IN_PYPY 0
185 #define CYTHON_COMPILING_IN_PYSTON 0
186 #define CYTHON_COMPILING_IN_CPYTHON 1
187 #ifndef CYTHON_USE_TYPE_SLOTS
188 #define CYTHON_USE_TYPE_SLOTS 1
190 #if PY_VERSION_HEX < 0x02070000
191 #undef CYTHON_USE_PYTYPE_LOOKUP
192 #define CYTHON_USE_PYTYPE_LOOKUP 0
193 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
194 #define CYTHON_USE_PYTYPE_LOOKUP 1
196 #if PY_MAJOR_VERSION < 3
197 #undef CYTHON_USE_ASYNC_SLOTS
198 #define CYTHON_USE_ASYNC_SLOTS 0
199 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
200 #define CYTHON_USE_ASYNC_SLOTS 1
202 #if PY_VERSION_HEX < 0x02070000
203 #undef CYTHON_USE_PYLONG_INTERNALS
204 #define CYTHON_USE_PYLONG_INTERNALS 0
205 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
206 #define CYTHON_USE_PYLONG_INTERNALS 1
208 #ifndef CYTHON_USE_PYLIST_INTERNALS
209 #define CYTHON_USE_PYLIST_INTERNALS 1
211 #ifndef CYTHON_USE_UNICODE_INTERNALS
212 #define CYTHON_USE_UNICODE_INTERNALS 1
214 #if PY_VERSION_HEX < 0x030300F0
215 #undef CYTHON_USE_UNICODE_WRITER
216 #define CYTHON_USE_UNICODE_WRITER 0
217 #elif !defined(CYTHON_USE_UNICODE_WRITER)
218 #define CYTHON_USE_UNICODE_WRITER 1
220 #ifndef CYTHON_AVOID_BORROWED_REFS
221 #define CYTHON_AVOID_BORROWED_REFS 0
223 #ifndef CYTHON_ASSUME_SAFE_MACROS
224 #define CYTHON_ASSUME_SAFE_MACROS 1
226 #ifndef CYTHON_UNPACK_METHODS
227 #define CYTHON_UNPACK_METHODS 1
229 #ifndef CYTHON_FAST_THREAD_STATE
230 #define CYTHON_FAST_THREAD_STATE 1
232 #ifndef CYTHON_FAST_PYCALL
233 #define CYTHON_FAST_PYCALL 1
235 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
236 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
238 #ifndef CYTHON_USE_TP_FINALIZE
239 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
241 #ifndef CYTHON_USE_DICT_VERSIONS
242 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
244 #ifndef CYTHON_USE_EXC_INFO_STACK
245 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
248 #if !defined(CYTHON_FAST_PYCCALL)
249 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
251 #if CYTHON_USE_PYLONG_INTERNALS
252 #include "longintrepr.h"
257 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
260 #ifndef __has_attribute
261 #define __has_attribute(x) 0
263 #ifndef __has_cpp_attribute
264 #define __has_cpp_attribute(x) 0
266 #ifndef CYTHON_RESTRICT
267 #if defined(__GNUC__)
268 #define CYTHON_RESTRICT __restrict__
269 #elif defined(_MSC_VER) && _MSC_VER >= 1400
270 #define CYTHON_RESTRICT __restrict
271 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
272 #define CYTHON_RESTRICT restrict
274 #define CYTHON_RESTRICT
277 #ifndef CYTHON_UNUSED
278 # if defined(__GNUC__)
279 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
280 # define CYTHON_UNUSED __attribute__ ((__unused__))
282 # define CYTHON_UNUSED
284 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
285 # define CYTHON_UNUSED __attribute__ ((__unused__))
287 # define CYTHON_UNUSED
290 #ifndef CYTHON_MAYBE_UNUSED_VAR
291 # if defined(__cplusplus)
292 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
294 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
297 #ifndef CYTHON_NCP_UNUSED
298 # if CYTHON_COMPILING_IN_CPYTHON
299 # define CYTHON_NCP_UNUSED
301 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
304 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
306 #ifndef _MSC_STDINT_H_
308 typedef unsigned char uint8_t;
309 typedef unsigned int uint32_t;
311 typedef unsigned __int8 uint8_t;
312 typedef unsigned __int32 uint32_t;
318 #ifndef CYTHON_FALLTHROUGH
319 #if defined(__cplusplus) && __cplusplus >= 201103L
320 #if __has_cpp_attribute(fallthrough)
321 #define CYTHON_FALLTHROUGH [[fallthrough]]
322 #elif __has_cpp_attribute(clang::fallthrough)
323 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
324 #elif __has_cpp_attribute(gnu::fallthrough)
325 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
328 #ifndef CYTHON_FALLTHROUGH
329 #if __has_attribute(fallthrough)
330 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
332 #define CYTHON_FALLTHROUGH
335 #if defined(__clang__ ) && defined(__apple_build_version__)
336 #if __apple_build_version__ < 7000000
337 #undef CYTHON_FALLTHROUGH
338 #define CYTHON_FALLTHROUGH
344 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
346 #ifndef CYTHON_INLINE
347 #if defined(__clang__)
348 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
350 #define CYTHON_INLINE inline
354 void __Pyx_call_destructor(T& x) {
358 class __Pyx_FakeReference {
360 __Pyx_FakeReference() : ptr(NULL) { }
361 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
362 T *operator->() {
return ptr; }
363 T *operator&() {
return ptr; }
364 operator T&() {
return *ptr; }
365 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
366 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
371 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
372 #define Py_OptimizeFlag 0
374 #define __PYX_BUILD_PY_SSIZE_T "n"
375 #define CYTHON_FORMAT_SSIZE_T "z"
376 #if PY_MAJOR_VERSION < 3
377 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
378 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
379 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
380 #define __Pyx_DefaultClassType PyClass_Type
382 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
383 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
384 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
385 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
387 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
388 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
390 #define __Pyx_DefaultClassType PyType_Type
392 #ifndef Py_TPFLAGS_CHECKTYPES
393 #define Py_TPFLAGS_CHECKTYPES 0
395 #ifndef Py_TPFLAGS_HAVE_INDEX
396 #define Py_TPFLAGS_HAVE_INDEX 0
398 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
399 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
401 #ifndef Py_TPFLAGS_HAVE_FINALIZE
402 #define Py_TPFLAGS_HAVE_FINALIZE 0
404 #ifndef METH_STACKLESS
405 #define METH_STACKLESS 0
407 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
408 #ifndef METH_FASTCALL
409 #define METH_FASTCALL 0x80
411 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
412 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
413 Py_ssize_t nargs, PyObject *kwnames);
415 #define __Pyx_PyCFunctionFast _PyCFunctionFast
416 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
418 #if CYTHON_FAST_PYCCALL
419 #define __Pyx_PyFastCFunction_Check(func)\
420 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
422 #define __Pyx_PyFastCFunction_Check(func) 0
424 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
425 #define PyObject_Malloc(s) PyMem_Malloc(s)
426 #define PyObject_Free(p) PyMem_Free(p)
427 #define PyObject_Realloc(p) PyMem_Realloc(p)
429 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
430 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
431 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
432 #define PyMem_RawFree(p) PyMem_Free(p)
434 #if CYTHON_COMPILING_IN_PYSTON
435 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
436 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
438 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
439 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
441 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
442 #define __Pyx_PyThreadState_Current PyThreadState_GET()
443 #elif PY_VERSION_HEX >= 0x03060000
444 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
445 #elif PY_VERSION_HEX >= 0x03000000
446 #define __Pyx_PyThreadState_Current PyThreadState_GET()
448 #define __Pyx_PyThreadState_Current _PyThreadState_Current
450 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
451 #include "pythread.h"
452 #define Py_tss_NEEDS_INIT 0
453 typedef int Py_tss_t;
454 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
455 *key = PyThread_create_key();
458 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
459 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
460 *key = Py_tss_NEEDS_INIT;
463 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
466 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
467 return *key != Py_tss_NEEDS_INIT;
469 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
470 PyThread_delete_key(*key);
471 *key = Py_tss_NEEDS_INIT;
473 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
474 return PyThread_set_key_value(*key, value);
476 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
477 return PyThread_get_key_value(*key);
480 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
481 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
483 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
485 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
486 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
487 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
489 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
490 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
492 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
493 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
495 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
497 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
498 #define CYTHON_PEP393_ENABLED 1
499 #if defined(PyUnicode_IS_READY)
500 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
501 0 : _PyUnicode_Ready((PyObject *)(op)))
503 #define __Pyx_PyUnicode_READY(op) (0)
505 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
506 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
507 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
508 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
509 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
510 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
511 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
512 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
513 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
514 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
516 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
519 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
522 #define CYTHON_PEP393_ENABLED 0
523 #define PyUnicode_1BYTE_KIND 1
524 #define PyUnicode_2BYTE_KIND 2
525 #define PyUnicode_4BYTE_KIND 4
526 #define __Pyx_PyUnicode_READY(op) (0)
527 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
528 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
529 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
530 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
531 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
532 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
533 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
534 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
536 #if CYTHON_COMPILING_IN_PYPY
537 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
538 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
540 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
541 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
542 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
544 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
545 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
547 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
548 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
550 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
551 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
553 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
554 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
555 #if PY_MAJOR_VERSION >= 3
556 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
558 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
560 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
561 #define PyObject_ASCII(o) PyObject_Repr(o)
563 #if PY_MAJOR_VERSION >= 3
564 #define PyBaseString_Type PyUnicode_Type
565 #define PyStringObject PyUnicodeObject
566 #define PyString_Type PyUnicode_Type
567 #define PyString_Check PyUnicode_Check
568 #define PyString_CheckExact PyUnicode_CheckExact
569 #ifndef PyObject_Unicode
570 #define PyObject_Unicode PyObject_Str
573 #if PY_MAJOR_VERSION >= 3
574 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
575 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
577 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
578 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
580 #ifndef PySet_CheckExact
581 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
583 #if PY_VERSION_HEX >= 0x030900A4
584 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
585 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
587 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
588 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
590 #if CYTHON_ASSUME_SAFE_MACROS
591 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
593 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
595 #if PY_MAJOR_VERSION >= 3
596 #define PyIntObject PyLongObject
597 #define PyInt_Type PyLong_Type
598 #define PyInt_Check(op) PyLong_Check(op)
599 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
600 #define PyInt_FromString PyLong_FromString
601 #define PyInt_FromUnicode PyLong_FromUnicode
602 #define PyInt_FromLong PyLong_FromLong
603 #define PyInt_FromSize_t PyLong_FromSize_t
604 #define PyInt_FromSsize_t PyLong_FromSsize_t
605 #define PyInt_AsLong PyLong_AsLong
606 #define PyInt_AS_LONG PyLong_AS_LONG
607 #define PyInt_AsSsize_t PyLong_AsSsize_t
608 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
609 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
610 #define PyNumber_Int PyNumber_Long
612 #if PY_MAJOR_VERSION >= 3
613 #define PyBoolObject PyLongObject
615 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
616 #ifndef PyUnicode_InternFromString
617 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
620 #if PY_VERSION_HEX < 0x030200A4
621 typedef long Py_hash_t;
622 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
623 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
625 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
626 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
628 #if PY_MAJOR_VERSION >= 3
629 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
631 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
633 #if CYTHON_USE_ASYNC_SLOTS
634 #if PY_VERSION_HEX >= 0x030500B1
635 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
636 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
638 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
641 #define __Pyx_PyType_AsAsync(obj) NULL
643 #ifndef __Pyx_PyAsyncMethodsStruct
648 } __Pyx_PyAsyncMethodsStruct;
651 #if defined(WIN32) || defined(MS_WINDOWS)
652 #define _USE_MATH_DEFINES
656 #define __PYX_NAN() ((float) NAN)
658 static CYTHON_INLINE
float __PYX_NAN() {
660 memset(&value, 0xFF,
sizeof(value));
664 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
665 #define __Pyx_truncl trunc
667 #define __Pyx_truncl truncl
670 #define __PYX_MARK_ERR_POS(f_index, lineno) \
671 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
672 #define __PYX_ERR(f_index, lineno, Ln_error) \
673 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
675 #ifndef __PYX_EXTERN_C
677 #define __PYX_EXTERN_C extern "C"
679 #define __PYX_EXTERN_C extern
683 #define __PYX_HAVE__imate___c_linear_operator__py_c_affine_matrix_function
684 #define __PYX_HAVE_API__imate___c_linear_operator__py_c_affine_matrix_function
695 #include "pythread.h"
704 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
705 #define CYTHON_WITHOUT_ASSERTIONS
708 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
709 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
711 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
712 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
713 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
714 #define __PYX_DEFAULT_STRING_ENCODING ""
715 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
716 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
717 #define __Pyx_uchar_cast(c) ((unsigned char)c)
718 #define __Pyx_long_cast(x) ((long)x)
719 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
720 (sizeof(type) < sizeof(Py_ssize_t)) ||\
721 (sizeof(type) > sizeof(Py_ssize_t) &&\
722 likely(v < (type)PY_SSIZE_T_MAX ||\
723 v == (type)PY_SSIZE_T_MAX) &&\
724 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
725 v == (type)PY_SSIZE_T_MIN))) ||\
726 (sizeof(type) == sizeof(Py_ssize_t) &&\
727 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
728 v == (type)PY_SSIZE_T_MAX))) )
729 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
730 return (
size_t) i < (size_t) limit;
732 #if defined (__cplusplus) && __cplusplus >= 201103L
734 #define __Pyx_sst_abs(value) std::abs(value)
735 #elif SIZEOF_INT >= SIZEOF_SIZE_T
736 #define __Pyx_sst_abs(value) abs(value)
737 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
738 #define __Pyx_sst_abs(value) labs(value)
739 #elif defined (_MSC_VER)
740 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
741 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
742 #define __Pyx_sst_abs(value) llabs(value)
743 #elif defined (__GNUC__)
744 #define __Pyx_sst_abs(value) __builtin_llabs(value)
746 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
748 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
749 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
750 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
751 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
752 #define __Pyx_PyBytes_FromString PyBytes_FromString
753 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
754 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
755 #if PY_MAJOR_VERSION < 3
756 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
757 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
759 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
760 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
762 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
763 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
764 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
765 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
766 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
767 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
768 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
769 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
770 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
771 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
772 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
773 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
774 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
775 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
776 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
777 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
778 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
779 const Py_UNICODE *u_end = u;
781 return (
size_t)(u_end - u - 1);
783 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
784 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
785 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
786 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
787 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
788 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
789 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
790 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
791 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
792 #define __Pyx_PySequence_Tuple(obj)\
793 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
794 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
795 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
796 #if CYTHON_ASSUME_SAFE_MACROS
797 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
799 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
801 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
802 #if PY_MAJOR_VERSION >= 3
803 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
805 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
807 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
808 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
809 static int __Pyx_sys_getdefaultencoding_not_ascii;
810 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
812 PyObject* default_encoding = NULL;
813 PyObject* ascii_chars_u = NULL;
814 PyObject* ascii_chars_b = NULL;
815 const char* default_encoding_c;
816 sys = PyImport_ImportModule(
"sys");
818 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
820 if (!default_encoding)
goto bad;
821 default_encoding_c = PyBytes_AsString(default_encoding);
822 if (!default_encoding_c)
goto bad;
823 if (strcmp(default_encoding_c,
"ascii") == 0) {
824 __Pyx_sys_getdefaultencoding_not_ascii = 0;
826 char ascii_chars[128];
828 for (c = 0; c < 128; c++) {
831 __Pyx_sys_getdefaultencoding_not_ascii = 1;
832 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
833 if (!ascii_chars_u)
goto bad;
834 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
835 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
838 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
842 Py_DECREF(ascii_chars_u);
843 Py_DECREF(ascii_chars_b);
845 Py_DECREF(default_encoding);
848 Py_XDECREF(default_encoding);
849 Py_XDECREF(ascii_chars_u);
850 Py_XDECREF(ascii_chars_b);
854 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
855 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
857 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
858 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
859 static char* __PYX_DEFAULT_STRING_ENCODING;
860 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
862 PyObject* default_encoding = NULL;
863 char* default_encoding_c;
864 sys = PyImport_ImportModule(
"sys");
866 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
868 if (!default_encoding)
goto bad;
869 default_encoding_c = PyBytes_AsString(default_encoding);
870 if (!default_encoding_c)
goto bad;
871 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
872 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
873 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
874 Py_DECREF(default_encoding);
877 Py_XDECREF(default_encoding);
885 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
886 #define likely(x) __builtin_expect(!!(x), 1)
887 #define unlikely(x) __builtin_expect(!!(x), 0)
889 #define likely(x) (x)
890 #define unlikely(x) (x)
892 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
894 static PyObject *__pyx_m = NULL;
895 static PyObject *__pyx_d;
896 static PyObject *__pyx_b;
897 static PyObject *__pyx_cython_runtime = NULL;
898 static PyObject *__pyx_empty_tuple;
899 static PyObject *__pyx_empty_bytes;
900 static PyObject *__pyx_empty_unicode;
901 static int __pyx_lineno;
902 static int __pyx_clineno = 0;
903 static const char * __pyx_cfilenm= __FILE__;
904 static const char *__pyx_filename;
907 static const char *__pyx_f[] = {
908 "imate/_c_linear_operator/py_c_affine_matrix_function.pyx",
912 struct __pyx_memoryview_obj;
914 struct __pyx_memoryview_obj *memview;
917 Py_ssize_t strides[8];
918 Py_ssize_t suboffsets[8];
919 } __Pyx_memviewslice;
920 #define __Pyx_MemoryView_Len(m) (m.shape[0])
923 #include <pythread.h>
924 #ifndef CYTHON_ATOMICS
925 #define CYTHON_ATOMICS 1
927 #define __pyx_atomic_int_type int
928 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
929 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
931 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
932 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
933 #ifdef __PYX_DEBUG_ATOMICS
934 #warning "Using GNU atomics"
936 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
938 #undef __pyx_atomic_int_type
939 #define __pyx_atomic_int_type LONG
940 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
941 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
942 #ifdef __PYX_DEBUG_ATOMICS
943 #pragma message ("Using MSVC atomics")
945 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
946 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
947 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
948 #ifdef __PYX_DEBUG_ATOMICS
949 #warning "Using Intel atomics"
952 #undef CYTHON_ATOMICS
953 #define CYTHON_ATOMICS 0
954 #ifdef __PYX_DEBUG_ATOMICS
955 #warning "Not using atomics"
958 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
960 #define __pyx_add_acquisition_count(memview)\
961 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
962 #define __pyx_sub_acquisition_count(memview)\
963 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
965 #define __pyx_add_acquisition_count(memview)\
966 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
967 #define __pyx_sub_acquisition_count(memview)\
968 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
972 #ifndef __PYX_FORCE_INIT_THREADS
973 #define __PYX_FORCE_INIT_THREADS 0
977 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
978 #define __Pyx_PyGILState_Release PyGILState_Release
979 #define __Pyx_FastGIL_Remember()
980 #define __Pyx_FastGIL_Forget()
981 #define __Pyx_FastGilFuncInit()
984 #define IS_UNSIGNED(type) (((type) -1) > 0)
985 struct __Pyx_StructField_;
986 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
989 struct __Pyx_StructField_* fields;
997 typedef struct __Pyx_StructField_ {
998 __Pyx_TypeInfo* type;
1001 } __Pyx_StructField;
1003 __Pyx_StructField* field;
1004 size_t parent_offset;
1005 } __Pyx_BufFmt_StackElem;
1007 __Pyx_StructField root;
1008 __Pyx_BufFmt_StackElem* head;
1010 size_t new_count, enc_count;
1011 size_t struct_alignment;
1016 char is_valid_array;
1017 } __Pyx_BufFmt_Context;
1027 typedef int __pyx_t_5imate_12_definitions_5types_LongIndexType;
1036 typedef int const __pyx_t_5imate_12_definitions_5types_ConstLongIndexType;
1045 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1054 typedef int const __pyx_t_5imate_12_definitions_5types_ConstIndexType;
1063 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1072 typedef int const __pyx_t_5imate_12_definitions_5types_ConstFlagType;
1075 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1076 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
1077 struct __pyx_array_obj;
1078 struct __pyx_MemviewEnum_obj;
1079 struct __pyx_memoryview_obj;
1080 struct __pyx_memoryviewslice_obj;
1089 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1098 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1107 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1116 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(
double const ,
double const );
1125 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1127 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1131 char *data_type_name;
1132 char *long_index_type_name;
1133 __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1134 PyObject *parameters;
1145 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction {
1146 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1149 PyObject *A_indices_copy;
1150 PyObject *A_index_pointer_copy;
1151 PyObject *B_indices_copy;
1152 PyObject *B_index_pointer_copy;
1163 struct __pyx_array_obj {
1165 struct __pyx_vtabstruct_array *__pyx_vtab;
1171 Py_ssize_t *_strides;
1172 Py_ssize_t itemsize;
1175 void (*callback_free_data)(
void *);
1177 int dtype_is_object;
1188 struct __pyx_MemviewEnum_obj {
1201 struct __pyx_memoryview_obj {
1203 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1206 PyObject *_array_interface;
1207 PyThread_type_lock lock;
1208 __pyx_atomic_int acquisition_count[2];
1209 __pyx_atomic_int *acquisition_count_aligned_p;
1212 int dtype_is_object;
1213 __Pyx_TypeInfo *typeinfo;
1224 struct __pyx_memoryviewslice_obj {
1225 struct __pyx_memoryview_obj __pyx_base;
1226 __Pyx_memviewslice from_slice;
1227 PyObject *from_object;
1228 PyObject *(*to_object_func)(
char *);
1229 int (*to_dtype_func)(
char *, PyObject *);
1242 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1243 __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_rows)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1244 __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_columns)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1245 cLinearOperator<float> *(*get_linear_operator_float)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1246 cLinearOperator<double> *(*get_linear_operator_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1247 cLinearOperator<long double> *(*get_linear_operator_long_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1248 void (*dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1249 void (*transpose_dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1251 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1262 struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction {
1263 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1265 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
1276 struct __pyx_vtabstruct_array {
1277 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1279 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1290 struct __pyx_vtabstruct_memoryview {
1291 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1292 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1293 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1294 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1295 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1296 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1297 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1299 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1310 struct __pyx_vtabstruct__memoryviewslice {
1311 struct __pyx_vtabstruct_memoryview __pyx_base;
1313 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1317 #ifndef CYTHON_REFNANNY
1318 #define CYTHON_REFNANNY 0
1322 void (*INCREF)(
void*, PyObject*, int);
1323 void (*DECREF)(
void*, PyObject*, int);
1324 void (*GOTREF)(
void*, PyObject*, int);
1325 void (*GIVEREF)(
void*, PyObject*, int);
1326 void* (*SetupContext)(
const char*, int,
const char*);
1327 void (*FinishContext)(
void**);
1328 } __Pyx_RefNannyAPIStruct;
1329 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1330 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1331 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1333 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1335 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1336 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1337 PyGILState_Release(__pyx_gilstate_save);\
1339 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1342 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1343 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1345 #define __Pyx_RefNannyFinishContext()\
1346 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1347 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1348 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1349 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1350 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1351 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1352 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1353 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1354 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1356 #define __Pyx_RefNannyDeclarations
1357 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1358 #define __Pyx_RefNannyFinishContext()
1359 #define __Pyx_INCREF(r) Py_INCREF(r)
1360 #define __Pyx_DECREF(r) Py_DECREF(r)
1361 #define __Pyx_GOTREF(r)
1362 #define __Pyx_GIVEREF(r)
1363 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1364 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1365 #define __Pyx_XGOTREF(r)
1366 #define __Pyx_XGIVEREF(r)
1368 #define __Pyx_XDECREF_SET(r, v) do {\
1369 PyObject *tmp = (PyObject *) r;\
1370 r = v; __Pyx_XDECREF(tmp);\
1372 #define __Pyx_DECREF_SET(r, v) do {\
1373 PyObject *tmp = (PyObject *) r;\
1374 r = v; __Pyx_DECREF(tmp);\
1376 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1377 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1380 #if CYTHON_USE_TYPE_SLOTS
1381 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1383 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1387 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1390 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1393 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1394 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1395 const char* function_name);
1398 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1399 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1402 #if CYTHON_FAST_THREAD_STATE
1403 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1404 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1405 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1407 #define __Pyx_PyThreadState_declare
1408 #define __Pyx_PyThreadState_assign
1409 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1413 #if CYTHON_FAST_THREAD_STATE
1414 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1415 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1416 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1417 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1418 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1419 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1420 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1421 #if CYTHON_COMPILING_IN_CPYTHON
1422 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1424 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1427 #define __Pyx_PyErr_Clear() PyErr_Clear()
1428 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1429 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1430 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1431 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1432 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1433 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1434 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1438 #ifndef CYTHON_PROFILE
1439 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1440 #define CYTHON_PROFILE 0
1442 #define CYTHON_PROFILE 1
1445 #ifndef CYTHON_TRACE_NOGIL
1446 #define CYTHON_TRACE_NOGIL 0
1448 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1449 #define CYTHON_TRACE 1
1452 #ifndef CYTHON_TRACE
1453 #define CYTHON_TRACE 0
1456 #undef CYTHON_PROFILE_REUSE_FRAME
1458 #ifndef CYTHON_PROFILE_REUSE_FRAME
1459 #define CYTHON_PROFILE_REUSE_FRAME 0
1461 #if CYTHON_PROFILE || CYTHON_TRACE
1462 #include "compile.h"
1463 #include "frameobject.h"
1464 #include "traceback.h"
1465 #if CYTHON_PROFILE_REUSE_FRAME
1466 #define CYTHON_FRAME_MODIFIER static
1467 #define CYTHON_FRAME_DEL(frame)
1469 #define CYTHON_FRAME_MODIFIER
1470 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1472 #define __Pyx_TraceDeclarations\
1473 static PyCodeObject *__pyx_frame_code = NULL;\
1474 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1475 int __Pyx_use_tracing = 0;
1476 #define __Pyx_TraceFrameInit(codeobj)\
1477 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1478 #if PY_VERSION_HEX >= 0x030a00b1
1479 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1480 (unlikely((tstate)->cframe->use_tracing) &&\
1481 (!(check_tracing) || !(tstate)->tracing) &&\
1482 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1483 #define __Pyx_SetTracing(tstate, enable)\
1484 (tstate)->cframe->use_tracing = (enable)
1486 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1487 (unlikely((tstate)->use_tracing) &&\
1488 (!(check_tracing) || !(tstate)->tracing) &&\
1489 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1490 #define __Pyx_SetTracing(tstate, enable)\
1491 (tstate)->use_tracing = (enable)
1494 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1496 if (CYTHON_TRACE_NOGIL) {\
1497 PyThreadState *tstate;\
1498 PyGILState_STATE state = PyGILState_Ensure();\
1499 tstate = __Pyx_PyThreadState_Current;\
1500 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1501 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1503 PyGILState_Release(state);\
1504 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1507 PyThreadState* tstate = PyThreadState_GET();\
1508 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1509 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1510 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1514 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1515 { PyThreadState* tstate = PyThreadState_GET();\
1516 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1517 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1518 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1522 #define __Pyx_TraceException()\
1523 if (likely(!__Pyx_use_tracing)); else {\
1524 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1525 if (__Pyx_IsTracing(tstate, 0, 1)) {\
1527 __Pyx_SetTracing(tstate, 0);\
1528 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1530 if (CYTHON_TRACE && tstate->c_tracefunc)\
1531 tstate->c_tracefunc(\
1532 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1533 tstate->c_profilefunc(\
1534 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1535 Py_DECREF(exc_info);\
1537 __Pyx_SetTracing(tstate, 1);\
1541 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1542 PyObject *type, *value, *traceback;
1543 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1545 __Pyx_SetTracing(tstate, 0);
1546 if (CYTHON_TRACE && tstate->c_tracefunc)
1547 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1548 if (tstate->c_profilefunc)
1549 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1550 CYTHON_FRAME_DEL(frame);
1551 __Pyx_SetTracing(tstate, 1);
1553 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1556 #define __Pyx_TraceReturn(result, nogil)\
1557 if (likely(!__Pyx_use_tracing)); else {\
1559 if (CYTHON_TRACE_NOGIL) {\
1560 PyThreadState *tstate;\
1561 PyGILState_STATE state = PyGILState_Ensure();\
1562 tstate = __Pyx_PyThreadState_Current;\
1563 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1564 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1566 PyGILState_Release(state);\
1569 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1570 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1571 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1576 #define __Pyx_TraceReturn(result, nogil)\
1577 if (likely(!__Pyx_use_tracing)); else {\
1578 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1579 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1580 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1584 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno);
1585 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate,
const char *funcname,
const char *srcfile,
int firstlineno);
1587 #define __Pyx_TraceDeclarations
1588 #define __Pyx_TraceFrameInit(codeobj)
1589 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1590 #define __Pyx_TraceException()
1591 #define __Pyx_TraceReturn(result, nogil)
1594 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame,
int lineno) {
1596 PyObject *type, *value, *traceback;
1597 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1598 __Pyx_PyFrame_SetLineNumber(frame, lineno);
1600 __Pyx_SetTracing(tstate, 0);
1601 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1602 __Pyx_SetTracing(tstate, 1);
1605 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1609 Py_XDECREF(traceback);
1614 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1615 if (likely(!__Pyx_use_tracing)); else {\
1617 if (CYTHON_TRACE_NOGIL) {\
1619 PyThreadState *tstate;\
1620 PyGILState_STATE state = PyGILState_Ensure();\
1621 tstate = __Pyx_PyThreadState_Current;\
1622 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1623 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1625 PyGILState_Release(state);\
1626 if (unlikely(ret)) goto_error;\
1629 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1630 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1631 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1632 if (unlikely(ret)) goto_error;\
1637 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1638 if (likely(!__Pyx_use_tracing)); else {\
1639 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1640 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1641 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1642 if (unlikely(ret)) goto_error;\
1647 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1651 #if CYTHON_COMPILING_IN_CPYTHON
1652 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1654 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1658 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1661 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2,
long intval,
long inplace);
1667 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1670 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1671 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1672 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1673 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1674 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1675 (cache_var) = (value);
1676 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1677 static PY_UINT64_T __pyx_dict_version = 0;\
1678 static PyObject *__pyx_dict_cached_value = NULL;\
1679 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1680 (VAR) = __pyx_dict_cached_value;\
1682 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1683 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1686 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1687 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1688 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1690 #define __PYX_GET_DICT_VERSION(dict) (0)
1691 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1692 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1696 #if CYTHON_USE_DICT_VERSIONS
1697 #define __Pyx_GetModuleGlobalName(var, name) {\
1698 static PY_UINT64_T __pyx_dict_version = 0;\
1699 static PyObject *__pyx_dict_cached_value = NULL;\
1700 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1701 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1702 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1704 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1705 PY_UINT64_T __pyx_dict_version;\
1706 PyObject *__pyx_dict_cached_value;\
1707 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1709 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1711 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1712 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1713 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1717 #if CYTHON_FAST_PYCCALL
1718 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1720 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1724 #if CYTHON_FAST_PYCALL
1725 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1726 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1727 #if 1 || PY_VERSION_HEX < 0x030600B1
1728 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1730 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1732 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1733 (sizeof(char [1 - 2*!(cond)]) - 1)
1734 #ifndef Py_MEMBER_SIZE
1735 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1737 static size_t __pyx_pyframe_localsplus_offset = 0;
1738 #include "frameobject.h"
1739 #define __Pxy_PyFrame_Initialize_Offsets()\
1740 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1741 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1742 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1743 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1747 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1750 #if CYTHON_COMPILING_IN_CPYTHON
1751 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1755 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1758 #if CYTHON_COMPILING_IN_CPYTHON
1759 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1761 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1765 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1766 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1767 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1768 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1769 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1770 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1771 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1772 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1773 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1774 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1775 int wraparound,
int boundscheck);
1776 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1777 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1778 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1779 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1780 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1781 int wraparound,
int boundscheck);
1782 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1783 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1784 int is_list,
int wraparound,
int boundscheck);
1787 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1788 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1789 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1790 (likely(PyDict_CheckExact(obj)) ?\
1791 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1793 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1794 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1798 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1799 #define __Pyx_MEMVIEW_DIRECT 1
1800 #define __Pyx_MEMVIEW_PTR 2
1801 #define __Pyx_MEMVIEW_FULL 4
1802 #define __Pyx_MEMVIEW_CONTIG 8
1803 #define __Pyx_MEMVIEW_STRIDED 16
1804 #define __Pyx_MEMVIEW_FOLLOW 32
1805 #define __Pyx_IS_C_CONTIG 1
1806 #define __Pyx_IS_F_CONTIG 2
1807 static int __Pyx_init_memviewslice(
1808 struct __pyx_memoryview_obj *memview,
1810 __Pyx_memviewslice *memviewslice,
1811 int memview_is_new_reference);
1812 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1813 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1814 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1815 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1816 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1817 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1818 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1819 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1820 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1821 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1824 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1825 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1826 __Pyx__ArgTypeTest(obj, type, name, exact))
1827 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1830 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1833 #if PY_MAJOR_VERSION >= 3
1834 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1836 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1840 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1841 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1843 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1845 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1846 int lineno,
const char *filename,
1847 int full_traceback,
int nogil);
1849 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1851 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1854 #if CYTHON_USE_TYPE_SLOTS
1855 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1857 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1861 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *s, Py_ssize_t size,
const char *errors) {
1863 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1865 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *s, Py_ssize_t size,
const char *errors) {
1867 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1869 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *s, Py_ssize_t size,
const char *errors) {
1871 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1875 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1876 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1877 const char* encoding,
const char* errors,
1878 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors));
1881 #if CYTHON_FAST_THREAD_STATE
1882 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1883 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1885 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1889 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1892 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1895 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1898 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1901 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1904 #if CYTHON_USE_EXC_INFO_STACK
1905 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1909 #if CYTHON_FAST_THREAD_STATE
1910 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1911 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1912 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1913 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1915 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1916 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1920 #if CYTHON_FAST_THREAD_STATE
1921 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1922 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1924 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1928 #if CYTHON_FAST_THREAD_STATE
1929 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1930 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1932 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1936 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1939 #if CYTHON_COMPILING_IN_CPYTHON
1940 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1941 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1942 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1943 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1945 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1946 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1947 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1949 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1951 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1953 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1954 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1955 PyListObject* L = (PyListObject*) list;
1956 Py_ssize_t len = Py_SIZE(list);
1957 if (likely(L->allocated > len)) {
1959 PyList_SET_ITEM(list, len, x);
1960 __Pyx_SET_SIZE(list, len + 1);
1963 return PyList_Append(list, x);
1966 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1970 #if !CYTHON_COMPILING_IN_PYPY
1971 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1973 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1974 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1978 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1979 #if CYTHON_COMPILING_IN_CPYTHON
1980 PyObject* none = _PyList_Extend((PyListObject*)L, v);
1981 if (unlikely(!none))
1986 return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1991 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1992 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1993 PyListObject* L = (PyListObject*) list;
1994 Py_ssize_t len = Py_SIZE(list);
1995 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1997 PyList_SET_ITEM(list, len, x);
1998 __Pyx_SET_SIZE(list, len + 1);
2001 return PyList_Append(list, x);
2004 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2008 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2011 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2014 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2017 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
2020 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v,
void *a, traverseproc current_tp_traverse);
2023 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
2026 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2027 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2029 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2033 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2034 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2036 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2040 #ifndef __PYX_HAVE_RT_ImportType_proto
2041 #define __PYX_HAVE_RT_ImportType_proto
2042 enum __Pyx_ImportType_CheckSize {
2043 __Pyx_ImportType_CheckSize_Error = 0,
2044 __Pyx_ImportType_CheckSize_Warn = 1,
2045 __Pyx_ImportType_CheckSize_Ignore = 2
2047 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2051 static void* __Pyx_GetVtable(PyObject *dict);
2054 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2057 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2060 static int __Pyx_setup_reduce(PyObject* type_obj);
2063 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2066 #define __Pyx_CyFunction_USED 1
2067 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2068 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2069 #define __Pyx_CYFUNCTION_CCLASS 0x04
2070 #define __Pyx_CyFunction_GetClosure(f)\
2071 (((__pyx_CyFunctionObject *) (f))->func_closure)
2072 #define __Pyx_CyFunction_GetClassObj(f)\
2073 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2074 #define __Pyx_CyFunction_Defaults(type, f)\
2075 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2076 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2077 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2079 PyCFunctionObject func;
2080 #if PY_VERSION_HEX < 0x030500A0
2081 PyObject *func_weakreflist;
2083 PyObject *func_dict;
2084 PyObject *func_name;
2085 PyObject *func_qualname;
2087 PyObject *func_globals;
2088 PyObject *func_code;
2089 PyObject *func_closure;
2090 PyObject *func_classobj;
2092 int defaults_pyobjects;
2093 size_t defaults_size;
2095 PyObject *defaults_tuple;
2096 PyObject *defaults_kwdict;
2097 PyObject *(*defaults_getter)(PyObject *);
2098 PyObject *func_annotations;
2099 } __pyx_CyFunctionObject;
2100 static PyTypeObject *__pyx_CyFunctionType = 0;
2101 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2102 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2103 int flags, PyObject* qualname,
2105 PyObject *module, PyObject *globals,
2107 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2110 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2112 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2114 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2116 static int __pyx_CyFunction_init(
void);
2119 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2120 int flags, PyObject* qualname,
2122 PyObject *module, PyObject *globals,
2126 #ifdef CYTHON_CLINE_IN_TRACEBACK
2127 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2129 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2134 PyCodeObject* code_object;
2136 } __Pyx_CodeObjectCacheEntry;
2137 struct __Pyx_CodeObjectCache {
2140 __Pyx_CodeObjectCacheEntry* entries;
2142 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2143 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2144 static PyCodeObject *__pyx_find_code_object(
int code_line);
2145 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2148 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2149 int py_line,
const char *filename);
2151 #if PY_MAJOR_VERSION < 3
2152 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2153 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2155 #define __Pyx_GetBuffer PyObject_GetBuffer
2156 #define __Pyx_ReleaseBuffer PyBuffer_Release
2162 Py_ssize_t shape, strides, suboffsets;
2163 } __Pyx_Buf_DimInfo;
2169 __Pyx_Buffer *rcbuffer;
2171 __Pyx_Buf_DimInfo diminfo[8];
2172 } __Pyx_LocalBuf_ND;
2175 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2178 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2179 __Pyx_memviewslice *slice2,
2180 int ndim,
size_t itemsize);
2183 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2186 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2187 #define __Pyx_HAS_GCC_DIAGNOSTIC
2191 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2194 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2195 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2196 __Pyx_BufFmt_StackElem* stack,
2197 __Pyx_TypeInfo* type);
2200 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2203 static int __Pyx_ValidateAndInit_memviewslice(
2208 __Pyx_TypeInfo *dtype,
2209 __Pyx_BufFmt_StackElem stack[],
2210 __Pyx_memviewslice *memviewslice,
2211 PyObject *original_obj);
2214 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *,
int writable_flag);
2217 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *,
int writable_flag);
2220 #ifndef __Pyx_CppExn2PyErr
2223 #include <stdexcept>
2225 static void __Pyx_CppExn2PyErr() {
2227 if (PyErr_Occurred())
2231 }
catch (
const std::bad_alloc& exn) {
2232 PyErr_SetString(PyExc_MemoryError, exn.what());
2233 }
catch (
const std::bad_cast& exn) {
2234 PyErr_SetString(PyExc_TypeError, exn.what());
2235 }
catch (
const std::bad_typeid& exn) {
2236 PyErr_SetString(PyExc_TypeError, exn.what());
2237 }
catch (
const std::domain_error& exn) {
2238 PyErr_SetString(PyExc_ValueError, exn.what());
2239 }
catch (
const std::invalid_argument& exn) {
2240 PyErr_SetString(PyExc_ValueError, exn.what());
2241 }
catch (
const std::ios_base::failure& exn) {
2242 PyErr_SetString(PyExc_IOError, exn.what());
2243 }
catch (
const std::out_of_range& exn) {
2244 PyErr_SetString(PyExc_IndexError, exn.what());
2245 }
catch (
const std::overflow_error& exn) {
2246 PyErr_SetString(PyExc_OverflowError, exn.what());
2247 }
catch (
const std::range_error& exn) {
2248 PyErr_SetString(PyExc_ArithmeticError, exn.what());
2249 }
catch (
const std::underflow_error& exn) {
2250 PyErr_SetString(PyExc_ArithmeticError, exn.what());
2251 }
catch (
const std::exception& exn) {
2252 PyErr_SetString(PyExc_RuntimeError, exn.what());
2256 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
2262 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *,
int writable_flag);
2265 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *,
int writable_flag);
2268 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *,
int writable_flag);
2271 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *,
int writable_flag);
2274 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *,
int writable_flag);
2277 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *,
int writable_flag);
2280 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2283 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *,
int writable_flag);
2286 static __Pyx_memviewslice
2287 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2288 const char *mode,
int ndim,
2289 size_t sizeof_dtype,
int contig_flag,
2290 int dtype_is_object);
2293 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2296 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2299 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2302 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2305 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2308 static int __Pyx_check_binary_version(
void);
2311 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2313 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2314 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2315 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2316 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2317 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2318 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2319 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2320 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2321 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2322 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2329 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2340 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = 0;
2341 static PyTypeObject *__pyx_array_type = 0;
2342 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2343 static PyTypeObject *__pyx_memoryview_type = 0;
2344 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2345 static PyObject *
generic = 0;
2346 static PyObject *strided = 0;
2347 static PyObject *indirect = 0;
2348 static PyObject *contiguous = 0;
2349 static PyObject *indirect_contiguous = 0;
2350 static int __pyx_memoryview_thread_locks_used;
2351 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2352 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2353 static void *__pyx_align_pointer(
void *,
size_t);
2354 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2355 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2356 static PyObject *_unellipsify(PyObject *,
int);
2357 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2358 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2359 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2360 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2361 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2362 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2363 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2364 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2365 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2366 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2367 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2368 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2369 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2370 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2371 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2372 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2373 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2374 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2375 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2376 static int __pyx_memoryview_err(PyObject *,
char *);
2377 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2378 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2379 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2380 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2381 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2382 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2383 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2384 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2385 static __Pyx_TypeInfo __Pyx_TypeInfo_float = {
"float", NULL,
sizeof(float), { 0 }, 0,
'R', 0, 0 };
2386 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2387 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = {
"long double", NULL,
sizeof(
long double), { 0 }, 0,
'R', 0, 0 };
2388 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2389 #define __Pyx_MODULE_NAME "imate._c_linear_operator.py_c_affine_matrix_function"
2390 extern int __pyx_module_is_main_imate___c_linear_operator__py_c_affine_matrix_function;
2391 int __pyx_module_is_main_imate___c_linear_operator__py_c_affine_matrix_function = 0;
2394 static PyObject *__pyx_builtin_ValueError;
2395 static PyObject *__pyx_builtin_TypeError;
2396 static PyObject *__pyx_builtin_MemoryError;
2397 static PyObject *__pyx_builtin_enumerate;
2398 static PyObject *__pyx_builtin_range;
2399 static PyObject *__pyx_builtin_Ellipsis;
2400 static PyObject *__pyx_builtin_id;
2401 static PyObject *__pyx_builtin_IndexError;
2402 static const char __pyx_k_A[] =
"A";
2403 static const char __pyx_k_B[] =
"B";
2404 static const char __pyx_k_O[] =
"O";
2405 static const char __pyx_k_c[] =
"c";
2406 static const char __pyx_k_id[] =
"id";
2407 static const char __pyx_k_new[] =
"__new__";
2408 static const char __pyx_k_obj[] =
"obj";
2409 static const char __pyx_k_base[] =
"base";
2410 static const char __pyx_k_copy[] =
"copy";
2411 static const char __pyx_k_data[] =
"data";
2412 static const char __pyx_k_dict[] =
"__dict__";
2413 static const char __pyx_k_main[] =
"__main__";
2414 static const char __pyx_k_mode[] =
"mode";
2415 static const char __pyx_k_name[] =
"name";
2416 static const char __pyx_k_ndim[] =
"ndim";
2417 static const char __pyx_k_pack[] =
"pack";
2418 static const char __pyx_k_self[] =
"self";
2419 static const char __pyx_k_size[] =
"size";
2420 static const char __pyx_k_step[] =
"step";
2421 static const char __pyx_k_stop[] =
"stop";
2422 static const char __pyx_k_test[] =
"__test__";
2423 static const char __pyx_k_ASCII[] =
"ASCII";
2424 static const char __pyx_k_class[] =
"__class__";
2425 static const char __pyx_k_dtype[] =
"dtype";
2426 static const char __pyx_k_error[] =
"error";
2427 static const char __pyx_k_flags[] =
"flags";
2428 static const char __pyx_k_numpy[] =
"numpy";
2429 static const char __pyx_k_range[] =
"range";
2430 static const char __pyx_k_shape[] =
"shape";
2431 static const char __pyx_k_start[] =
"start";
2432 static const char __pyx_k_A_data[] =
"A_data";
2433 static const char __pyx_k_B_data[] =
"B_data";
2434 static const char __pyx_k_astype[] =
"astype";
2435 static const char __pyx_k_encode[] =
"encode";
2436 static const char __pyx_k_format[] =
"format";
2437 static const char __pyx_k_import[] =
"__import__";
2438 static const char __pyx_k_indptr[] =
"indptr";
2439 static const char __pyx_k_name_2[] =
"__name__";
2440 static const char __pyx_k_pickle[] =
"pickle";
2441 static const char __pyx_k_reduce[] =
"__reduce__";
2442 static const char __pyx_k_struct[] =
"struct";
2443 static const char __pyx_k_unpack[] =
"unpack";
2444 static const char __pyx_k_update[] =
"update";
2445 static const char __pyx_k_float32[] =
"float32";
2446 static const char __pyx_k_float64[] =
"float64";
2447 static const char __pyx_k_fortran[] =
"fortran";
2448 static const char __pyx_k_indices[] =
"indices";
2449 static const char __pyx_k_memview[] =
"memview";
2450 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2451 static const char __pyx_k_float128[] =
"float128";
2452 static const char __pyx_k_getstate[] =
"__getstate__";
2453 static const char __pyx_k_issparse[] =
"issparse";
2454 static const char __pyx_k_itemsize[] =
"itemsize";
2455 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2456 static const char __pyx_k_setstate[] =
"__setstate__";
2457 static const char __pyx_k_A_data_mv[] =
"A_data_mv";
2458 static const char __pyx_k_A_indices[] =
"A_indices";
2459 static const char __pyx_k_B_data_mv[] =
"B_data_mv";
2460 static const char __pyx_k_B_indices[] =
"B_indices";
2461 static const char __pyx_k_TypeError[] =
"TypeError";
2462 static const char __pyx_k_enumerate[] =
"enumerate";
2463 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2464 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2465 static const char __pyx_k_A_num_rows[] =
"A_num_rows";
2466 static const char __pyx_k_IndexError[] =
"IndexError";
2467 static const char __pyx_k_ValueError[] =
"ValueError";
2468 static const char __pyx_k_csr_matrix[] =
"csr_matrix";
2469 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2470 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2471 static const char __pyx_k_A_data_mv_c[] =
"A_data_mv_c";
2472 static const char __pyx_k_A_data_mv_f[] =
"A_data_mv_f";
2473 static const char __pyx_k_B_data_mv_c[] =
"B_data_mv_c";
2474 static const char __pyx_k_B_data_mv_f[] =
"B_data_mv_f";
2475 static const char __pyx_k_MemoryError[] =
"MemoryError";
2476 static const char __pyx_k_PickleError[] =
"PickleError";
2477 static const char __pyx_k_A_indices_mv[] =
"A_indices_mv";
2478 static const char __pyx_k_B_indices_mv[] =
"B_indices_mv";
2479 static const char __pyx_k_C_CONTIGUOUS[] =
"C_CONTIGUOUS";
2480 static const char __pyx_k_F_CONTIGUOUS[] =
"F_CONTIGUOUS";
2481 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2482 static const char __pyx_k_scipy_sparse[] =
"scipy.sparse";
2483 static const char __pyx_k_sort_indices[] =
"sort_indices";
2484 static const char __pyx_k_stringsource[] =
"stringsource";
2485 static const char __pyx_k_A_num_columns[] =
"A_num_columns";
2486 static const char __pyx_k_B_is_identity[] =
"B_is_identity";
2487 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2488 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2489 static const char __pyx_k_A_is_row_major[] =
"A_is_row_major";
2490 static const char __pyx_k_B_is_row_major[] =
"B_is_row_major";
2491 static const char __pyx_k_isspmatrix_csc[] =
"isspmatrix_csc";
2492 static const char __pyx_k_isspmatrix_csr[] =
"isspmatrix_csr";
2493 static const char __pyx_k_A_index_pointer[] =
"A_index_pointer";
2494 static const char __pyx_k_B_index_pointer[] =
"B_index_pointer";
2495 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2496 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2497 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2498 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2499 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2500 static const char __pyx_k_A_cannot_be_None[] =
"A cannot be None.";
2501 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2502 static const char __pyx_k_A_index_pointer_mv[] =
"A_index_pointer_mv";
2503 static const char __pyx_k_B_index_pointer_mv[] =
"B_index_pointer_mv";
2504 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2505 static const char __pyx_k_has_sorted_indices[] =
"has_sorted_indices";
2506 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2507 static const char __pyx_k_set_csc_matrix_float[] =
"set_csc_matrix_float";
2508 static const char __pyx_k_set_csr_matrix_float[] =
"set_csr_matrix_float";
2509 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2510 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2511 static const char __pyx_k_set_csc_matrix_double[] =
"set_csc_matrix_double";
2512 static const char __pyx_k_set_csr_matrix_double[] =
"set_csr_matrix_double";
2513 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2514 static const char __pyx_k_set_dense_matrix_float[] =
"set_dense_matrix_float";
2515 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2516 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2517 static const char __pyx_k_pycAffineMatrixFunction[] =
"pycAffineMatrixFunction";
2518 static const char __pyx_k_set_dense_matrix_double[] =
"set_dense_matrix_double";
2519 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2520 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2521 static const char __pyx_k_set_csc_matrix_long_double[] =
"set_csc_matrix_long_double";
2522 static const char __pyx_k_set_csr_matrix_long_double[] =
"set_csr_matrix_long_double";
2523 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2524 static const char __pyx_k_set_dense_matrix_long_double[] =
"set_dense_matrix_long_double";
2525 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2526 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2527 static const char __pyx_k_pycAffineMatrixFunction_set_csc[] =
"pycAffineMatrixFunction.set_csc_matrix_float";
2528 static const char __pyx_k_pycAffineMatrixFunction_set_csr[] =
"pycAffineMatrixFunction.set_csr_matrix_float";
2529 static const char __pyx_k_A_and_B_should_have_similar_data[] =
"A and B should have similar data types.";
2530 static const char __pyx_k_A_and_B_should_have_the_same_sha[] =
"A and B should have the same shape.";
2531 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2532 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2533 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2534 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2535 static const char __pyx_k_Data_type_should_be_float32_floa[] =
"Data type should be float32, float64, or float128.";
2536 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2537 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] =
"Incompatible checksums (%s vs 0xb068931 = (name))";
2538 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2539 static const char __pyx_k_Input_matrix_should_be_a_2_dimen[] =
"Input matrix should be a 2-dimensional array.";
2540 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2541 static const char __pyx_k_Matrices_A_and_B_should_have_sim[] =
"Matrices A and B should have similar types.";
2542 static const char __pyx_k_Matrix_A_should_be_either_C_or_F[] =
"Matrix A should be either C or F contiguous.";
2543 static const char __pyx_k_Matrix_B_should_be_either_C_or_F[] =
"Matrix B should be either C or F contiguous.";
2544 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2545 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2546 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2547 static const char __pyx_k_imate__c_linear_operator_py_c_af[] =
"imate/_c_linear_operator/py_c_affine_matrix_function.pyx";
2548 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2549 static const char __pyx_k_pycAffineMatrixFunction___reduce[] =
"pycAffineMatrixFunction.__reduce_cython__";
2550 static const char __pyx_k_pycAffineMatrixFunction___setsta[] =
"pycAffineMatrixFunction.__setstate_cython__";
2551 static const char __pyx_k_pycAffineMatrixFunction_set_dens[] =
"pycAffineMatrixFunction.set_dense_matrix_float";
2552 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2553 static const char __pyx_k_pycAffineMatrixFunction_set_csc_2[] =
"pycAffineMatrixFunction.set_csc_matrix_double";
2554 static const char __pyx_k_pycAffineMatrixFunction_set_csc_3[] =
"pycAffineMatrixFunction.set_csc_matrix_long_double";
2555 static const char __pyx_k_pycAffineMatrixFunction_set_csr_2[] =
"pycAffineMatrixFunction.set_csr_matrix_double";
2556 static const char __pyx_k_pycAffineMatrixFunction_set_csr_3[] =
"pycAffineMatrixFunction.set_csr_matrix_long_double";
2557 static const char __pyx_k_imate__c_linear_operator_py_c_af_2[] =
"imate._c_linear_operator.py_c_affine_matrix_function";
2558 static const char __pyx_k_pycAffineMatrixFunction_set_dens_2[] =
"pycAffineMatrixFunction.set_dense_matrix_double";
2559 static const char __pyx_k_pycAffineMatrixFunction_set_dens_3[] =
"pycAffineMatrixFunction.set_dense_matrix_long_double";
2560 static PyObject *__pyx_n_s_A;
2561 static PyObject *__pyx_n_s_ASCII;
2562 static PyObject *__pyx_kp_u_A_and_B_should_have_similar_data;
2563 static PyObject *__pyx_kp_u_A_and_B_should_have_the_same_sha;
2564 static PyObject *__pyx_kp_u_A_cannot_be_None;
2565 static PyObject *__pyx_n_s_A_data;
2566 static PyObject *__pyx_n_s_A_data_mv;
2567 static PyObject *__pyx_n_s_A_data_mv_c;
2568 static PyObject *__pyx_n_s_A_data_mv_f;
2569 static PyObject *__pyx_n_s_A_index_pointer;
2570 static PyObject *__pyx_n_s_A_index_pointer_mv;
2571 static PyObject *__pyx_n_s_A_indices;
2572 static PyObject *__pyx_n_s_A_indices_mv;
2573 static PyObject *__pyx_n_s_A_is_row_major;
2574 static PyObject *__pyx_n_s_A_num_columns;
2575 static PyObject *__pyx_n_s_A_num_rows;
2576 static PyObject *__pyx_n_s_B;
2577 static PyObject *__pyx_n_s_B_data;
2578 static PyObject *__pyx_n_s_B_data_mv;
2579 static PyObject *__pyx_n_s_B_data_mv_c;
2580 static PyObject *__pyx_n_s_B_data_mv_f;
2581 static PyObject *__pyx_n_s_B_index_pointer;
2582 static PyObject *__pyx_n_s_B_index_pointer_mv;
2583 static PyObject *__pyx_n_s_B_indices;
2584 static PyObject *__pyx_n_s_B_indices_mv;
2585 static PyObject *__pyx_n_s_B_is_identity;
2586 static PyObject *__pyx_n_s_B_is_row_major;
2587 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2588 static PyObject *__pyx_n_u_C_CONTIGUOUS;
2589 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2590 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2591 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2592 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2593 static PyObject *__pyx_kp_u_Data_type_should_be_float32_floa;
2594 static PyObject *__pyx_n_s_Ellipsis;
2595 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2596 static PyObject *__pyx_n_u_F_CONTIGUOUS;
2597 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2598 static PyObject *__pyx_n_s_IndexError;
2599 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2600 static PyObject *__pyx_kp_u_Input_matrix_should_be_a_2_dimen;
2601 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2602 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2603 static PyObject *__pyx_kp_u_Matrices_A_and_B_should_have_sim;
2604 static PyObject *__pyx_kp_u_Matrix_A_should_be_either_C_or_F;
2605 static PyObject *__pyx_kp_u_Matrix_B_should_be_either_C_or_F;
2606 static PyObject *__pyx_n_s_MemoryError;
2607 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2608 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2609 static PyObject *__pyx_n_b_O;
2610 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2611 static PyObject *__pyx_n_s_PickleError;
2612 static PyObject *__pyx_n_s_TypeError;
2613 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2614 static PyObject *__pyx_n_s_ValueError;
2615 static PyObject *__pyx_n_s_View_MemoryView;
2616 static PyObject *__pyx_n_s_allocate_buffer;
2617 static PyObject *__pyx_n_s_astype;
2618 static PyObject *__pyx_n_s_base;
2619 static PyObject *__pyx_n_s_c;
2620 static PyObject *__pyx_n_u_c;
2621 static PyObject *__pyx_n_s_class;
2622 static PyObject *__pyx_n_s_cline_in_traceback;
2623 static PyObject *__pyx_kp_s_contiguous_and_direct;
2624 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2625 static PyObject *__pyx_n_s_copy;
2626 static PyObject *__pyx_n_s_csr_matrix;
2627 static PyObject *__pyx_n_s_data;
2628 static PyObject *__pyx_n_s_dict;
2629 static PyObject *__pyx_n_s_dtype;
2630 static PyObject *__pyx_n_s_dtype_is_object;
2631 static PyObject *__pyx_n_s_encode;
2632 static PyObject *__pyx_n_s_enumerate;
2633 static PyObject *__pyx_n_s_error;
2634 static PyObject *__pyx_n_s_flags;
2635 static PyObject *__pyx_n_b_float128;
2636 static PyObject *__pyx_n_b_float32;
2637 static PyObject *__pyx_n_b_float64;
2638 static PyObject *__pyx_n_s_format;
2639 static PyObject *__pyx_n_s_fortran;
2640 static PyObject *__pyx_n_u_fortran;
2641 static PyObject *__pyx_n_s_getstate;
2642 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2643 static PyObject *__pyx_n_s_has_sorted_indices;
2644 static PyObject *__pyx_n_s_id;
2645 static PyObject *__pyx_kp_s_imate__c_linear_operator_py_c_af;
2646 static PyObject *__pyx_n_s_imate__c_linear_operator_py_c_af_2;
2647 static PyObject *__pyx_n_s_import;
2648 static PyObject *__pyx_n_s_indices;
2649 static PyObject *__pyx_n_s_indptr;
2650 static PyObject *__pyx_n_s_issparse;
2651 static PyObject *__pyx_n_s_isspmatrix_csc;
2652 static PyObject *__pyx_n_s_isspmatrix_csr;
2653 static PyObject *__pyx_n_s_itemsize;
2654 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2655 static PyObject *__pyx_n_s_main;
2656 static PyObject *__pyx_n_s_memview;
2657 static PyObject *__pyx_n_s_mode;
2658 static PyObject *__pyx_n_s_name;
2659 static PyObject *__pyx_n_s_name_2;
2660 static PyObject *__pyx_n_s_ndim;
2661 static PyObject *__pyx_n_s_new;
2662 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2663 static PyObject *__pyx_n_s_numpy;
2664 static PyObject *__pyx_n_s_obj;
2665 static PyObject *__pyx_n_s_pack;
2666 static PyObject *__pyx_n_s_pickle;
2667 static PyObject *__pyx_n_s_pycAffineMatrixFunction;
2668 static PyObject *__pyx_n_s_pycAffineMatrixFunction___reduce;
2669 static PyObject *__pyx_n_s_pycAffineMatrixFunction___setsta;
2670 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csc;
2671 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csc_2;
2672 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csc_3;
2673 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csr;
2674 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csr_2;
2675 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csr_3;
2676 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_dens;
2677 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_dens_2;
2678 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_dens_3;
2679 static PyObject *__pyx_n_s_pyx_PickleError;
2680 static PyObject *__pyx_n_s_pyx_checksum;
2681 static PyObject *__pyx_n_s_pyx_getbuffer;
2682 static PyObject *__pyx_n_s_pyx_result;
2683 static PyObject *__pyx_n_s_pyx_state;
2684 static PyObject *__pyx_n_s_pyx_type;
2685 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2686 static PyObject *__pyx_n_s_pyx_vtable;
2687 static PyObject *__pyx_n_s_range;
2688 static PyObject *__pyx_n_s_reduce;
2689 static PyObject *__pyx_n_s_reduce_cython;
2690 static PyObject *__pyx_n_s_reduce_ex;
2691 static PyObject *__pyx_n_s_scipy_sparse;
2692 static PyObject *__pyx_n_s_self;
2693 static PyObject *__pyx_n_s_set_csc_matrix_double;
2694 static PyObject *__pyx_n_s_set_csc_matrix_float;
2695 static PyObject *__pyx_n_s_set_csc_matrix_long_double;
2696 static PyObject *__pyx_n_s_set_csr_matrix_double;
2697 static PyObject *__pyx_n_s_set_csr_matrix_float;
2698 static PyObject *__pyx_n_s_set_csr_matrix_long_double;
2699 static PyObject *__pyx_n_s_set_dense_matrix_double;
2700 static PyObject *__pyx_n_s_set_dense_matrix_float;
2701 static PyObject *__pyx_n_s_set_dense_matrix_long_double;
2702 static PyObject *__pyx_n_s_setstate;
2703 static PyObject *__pyx_n_s_setstate_cython;
2704 static PyObject *__pyx_n_s_shape;
2705 static PyObject *__pyx_n_s_size;
2706 static PyObject *__pyx_n_s_sort_indices;
2707 static PyObject *__pyx_n_s_start;
2708 static PyObject *__pyx_n_s_step;
2709 static PyObject *__pyx_n_s_stop;
2710 static PyObject *__pyx_kp_s_strided_and_direct;
2711 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2712 static PyObject *__pyx_kp_s_strided_and_indirect;
2713 static PyObject *__pyx_kp_s_stringsource;
2714 static PyObject *__pyx_n_s_struct;
2715 static PyObject *__pyx_n_s_test;
2716 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2717 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2718 static PyObject *__pyx_n_s_unpack;
2719 static PyObject *__pyx_n_s_update;
2720 static int __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B);
2721 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2722 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2723 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2724 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2725 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2726 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2727 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2728 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2729 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2730 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self);
2731 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2732 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2733 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2734 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2735 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2736 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2737 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2738 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2739 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2740 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2741 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2742 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2743 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2744 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2745 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2746 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2747 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2748 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2749 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2750 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2751 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2752 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2753 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2754 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2755 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2756 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2757 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2758 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2759 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2760 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2761 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2762 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2763 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2764 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2765 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2766 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2767 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2768 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2769 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2770 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2771 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2772 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2773 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2774 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyTypeObject *t, PyObject *a, PyObject *k);
2775 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2776 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2777 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2778 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2779 static PyObject *__pyx_int_0;
2780 static PyObject *__pyx_int_1;
2781 static PyObject *__pyx_int_2;
2782 static PyObject *__pyx_int_184977713;
2783 static PyObject *__pyx_int_neg_1;
2784 static PyObject *__pyx_tuple_;
2785 static PyObject *__pyx_tuple__2;
2786 static PyObject *__pyx_tuple__3;
2787 static PyObject *__pyx_tuple__4;
2788 static PyObject *__pyx_tuple__5;
2789 static PyObject *__pyx_tuple__6;
2790 static PyObject *__pyx_tuple__8;
2791 static PyObject *__pyx_tuple__9;
2792 static PyObject *__pyx_slice__36;
2793 static PyObject *__pyx_tuple__19;
2794 static PyObject *__pyx_tuple__21;
2795 static PyObject *__pyx_tuple__22;
2796 static PyObject *__pyx_tuple__23;
2797 static PyObject *__pyx_tuple__24;
2798 static PyObject *__pyx_tuple__25;
2799 static PyObject *__pyx_tuple__26;
2800 static PyObject *__pyx_tuple__27;
2801 static PyObject *__pyx_tuple__28;
2802 static PyObject *__pyx_tuple__29;
2803 static PyObject *__pyx_tuple__30;
2804 static PyObject *__pyx_tuple__31;
2805 static PyObject *__pyx_tuple__32;
2806 static PyObject *__pyx_tuple__33;
2807 static PyObject *__pyx_tuple__34;
2808 static PyObject *__pyx_tuple__35;
2809 static PyObject *__pyx_tuple__37;
2810 static PyObject *__pyx_tuple__38;
2811 static PyObject *__pyx_tuple__39;
2812 static PyObject *__pyx_tuple__41;
2813 static PyObject *__pyx_tuple__42;
2814 static PyObject *__pyx_tuple__43;
2815 static PyObject *__pyx_tuple__44;
2816 static PyObject *__pyx_tuple__45;
2817 static PyObject *__pyx_tuple__46;
2818 static PyObject *__pyx_tuple__47;
2819 static PyObject *__pyx_tuple__48;
2820 static PyObject *__pyx_tuple__49;
2821 static PyObject *__pyx_tuple__50;
2822 static PyObject *__pyx_tuple__51;
2823 static PyObject *__pyx_tuple__52;
2824 static PyObject *__pyx_tuple__53;
2825 static PyObject *__pyx_tuple__54;
2826 static PyObject *__pyx_tuple__55;
2827 static PyObject *__pyx_tuple__56;
2828 static PyObject *__pyx_tuple__57;
2829 static PyObject *__pyx_codeobj__7;
2830 static PyObject *__pyx_codeobj__10;
2831 static PyObject *__pyx_codeobj__11;
2832 static PyObject *__pyx_codeobj__12;
2833 static PyObject *__pyx_codeobj__13;
2834 static PyObject *__pyx_codeobj__14;
2835 static PyObject *__pyx_codeobj__15;
2836 static PyObject *__pyx_codeobj__16;
2837 static PyObject *__pyx_codeobj__17;
2838 static PyObject *__pyx_codeobj__18;
2839 static PyObject *__pyx_codeobj__20;
2840 static PyObject *__pyx_codeobj__40;
2852 static int __pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2853 static int __pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2854 PyObject *__pyx_v_A = 0;
2855 PyObject *__pyx_v_B = 0;
2856 int __pyx_lineno = 0;
2857 const char *__pyx_filename = NULL;
2858 int __pyx_clineno = 0;
2860 __Pyx_RefNannyDeclarations
2861 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2863 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,0};
2864 PyObject* values[2] = {0,0};
2865 values[1] = ((PyObject *)Py_None);
2866 if (unlikely(__pyx_kwds)) {
2868 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2870 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2872 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2875 default:
goto __pyx_L5_argtuple_error;
2877 kw_args = PyDict_Size(__pyx_kwds);
2880 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
2881 else goto __pyx_L5_argtuple_error;
2885 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B);
2886 if (value) { values[1] = value; kw_args--; }
2889 if (unlikely(kw_args > 0)) {
2890 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 172, __pyx_L3_error)
2893 switch (PyTuple_GET_SIZE(__pyx_args)) {
2894 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2896 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2898 default:
goto __pyx_L5_argtuple_error;
2901 __pyx_v_A = values[0];
2902 __pyx_v_B = values[1];
2904 goto __pyx_L4_argument_unpacking_done;
2905 __pyx_L5_argtuple_error:;
2906 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 172, __pyx_L3_error)
2908 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2909 __Pyx_RefNannyFinishContext();
2911 __pyx_L4_argument_unpacking_done:;
2912 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction___cinit__(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B);
2915 __Pyx_RefNannyFinishContext();
2919 static int __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B) {
2920 int __pyx_v_B_is_identity;
2922 __Pyx_TraceDeclarations
2923 __Pyx_RefNannyDeclarations
2926 PyObject *__pyx_t_3 = NULL;
2927 PyObject *__pyx_t_4 = NULL;
2928 PyObject *__pyx_t_5 = NULL;
2930 PyObject *__pyx_t_7 = NULL;
2932 PyObject *__pyx_t_9 = NULL;
2933 int __pyx_lineno = 0;
2934 const char *__pyx_filename = NULL;
2935 int __pyx_clineno = 0;
2936 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2937 __Pyx_TraceCall(
"__cinit__", __pyx_f[0], 172, 0, __PYX_ERR(0, 172, __pyx_L1_error));
2946 __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error))
2947 __pyx_t_1 = (__pyx_v_A == Py_None);
2948 __pyx_t_2 = (__pyx_t_1 != 0);
2949 if (unlikely(__pyx_t_2)) {
2958 __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error))
2959 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
2960 __Pyx_GOTREF(__pyx_t_3);
2961 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2962 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2963 __PYX_ERR(0, 179, __pyx_L1_error)
2981 __Pyx_TraceLine(181,0,__PYX_ERR(0, 181, __pyx_L1_error))
2982 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
2983 __Pyx_GOTREF(__pyx_t_3);
2984 __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_3, __pyx_int_2, 2, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
2985 __Pyx_GOTREF(__pyx_t_4);
2986 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2987 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 181, __pyx_L1_error)
2988 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2989 if (unlikely(__pyx_t_2)) {
2998 __Pyx_TraceLine(182,0,__PYX_ERR(0, 182, __pyx_L1_error))
2999 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
3000 __Pyx_GOTREF(__pyx_t_4);
3001 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3002 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3003 __PYX_ERR(0, 182, __pyx_L1_error)
3021 __Pyx_TraceLine(185,0,__PYX_ERR(0, 185, __pyx_L1_error))
3022 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
3023 __Pyx_GOTREF(__pyx_t_4);
3024 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 185, __pyx_L1_error)
3025 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3035 __Pyx_TraceLine(186,0,__PYX_ERR(0, 186, __pyx_L1_error))
3036 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float32");
3055 __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error))
3056 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
3057 __Pyx_GOTREF(__pyx_t_4);
3058 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
3059 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3069 __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error))
3070 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float64");
3089 __Pyx_TraceLine(189,0,__PYX_ERR(0, 189, __pyx_L1_error))
3090 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
3091 __Pyx_GOTREF(__pyx_t_4);
3092 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 189, __pyx_L1_error)
3093 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3094 if (likely(__pyx_t_2)) {
3103 __Pyx_TraceLine(190,0,__PYX_ERR(0, 190, __pyx_L1_error))
3104 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float128");
3123 __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
3125 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
3126 __Pyx_GOTREF(__pyx_t_4);
3127 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3128 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3129 __PYX_ERR(0, 192, __pyx_L1_error)
3140 __Pyx_TraceLine(196,0,__PYX_ERR(0, 196, __pyx_L1_error))
3141 __pyx_t_2 = (__pyx_v_B == Py_None);
3142 __pyx_t_1 = (__pyx_t_2 != 0);
3152 __Pyx_TraceLine(199,0,__PYX_ERR(0, 199, __pyx_L1_error))
3153 __pyx_v_B_is_identity = 1;
3172 __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error))
3174 __pyx_v_B_is_identity = 0;
3183 __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
3184 __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_A)), ((PyObject *)Py_TYPE(__pyx_v_B)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
3185 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 207, __pyx_L1_error)
3186 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3187 __pyx_t_2 = ((!__pyx_t_1) != 0);
3188 if (unlikely(__pyx_t_2)) {
3197 __Pyx_TraceLine(208,0,__PYX_ERR(0, 208, __pyx_L1_error))
3198 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
3199 __Pyx_GOTREF(__pyx_t_4);
3200 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3201 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3202 __PYX_ERR(0, 208, __pyx_L1_error)
3220 __Pyx_TraceLine(211,0,__PYX_ERR(0, 211, __pyx_L1_error))
3221 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
3222 __Pyx_GOTREF(__pyx_t_4);
3223 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
3224 __Pyx_GOTREF(__pyx_t_3);
3225 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
3226 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3227 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3228 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 211, __pyx_L1_error)
3229 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3230 __pyx_t_1 = ((!__pyx_t_2) != 0);
3231 if (unlikely(__pyx_t_1)) {
3240 __Pyx_TraceLine(212,0,__PYX_ERR(0, 212, __pyx_L1_error))
3241 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
3242 __Pyx_GOTREF(__pyx_t_5);
3243 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3244 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3245 __PYX_ERR(0, 212, __pyx_L1_error)
3263 __Pyx_TraceLine(215,0,__PYX_ERR(0, 215, __pyx_L1_error))
3264 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
3265 __Pyx_GOTREF(__pyx_t_5);
3266 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_shape);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
3267 __Pyx_GOTREF(__pyx_t_3);
3268 __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
3269 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3270 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3271 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 215, __pyx_L1_error)
3272 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3273 __pyx_t_2 = ((!__pyx_t_1) != 0);
3274 if (unlikely(__pyx_t_2)) {
3283 __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
3284 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
3285 __Pyx_GOTREF(__pyx_t_4);
3286 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3287 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3288 __PYX_ERR(0, 216, __pyx_L1_error)
3308 __Pyx_TraceLine(219,0,__PYX_ERR(0, 219, __pyx_L1_error))
3309 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_issparse);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error)
3310 __Pyx_GOTREF(__pyx_t_3);
3312 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3313 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3314 if (likely(__pyx_t_5)) {
3315 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3316 __Pyx_INCREF(__pyx_t_5);
3317 __Pyx_INCREF(
function);
3318 __Pyx_DECREF_SET(__pyx_t_3,
function);
3321 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3322 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3323 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
3324 __Pyx_GOTREF(__pyx_t_4);
3325 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3326 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 219, __pyx_L1_error)
3327 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3337 __Pyx_TraceLine(222,0,__PYX_ERR(0, 222, __pyx_L1_error))
3338 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
3339 __Pyx_GOTREF(__pyx_t_3);
3341 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3342 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3343 if (likely(__pyx_t_5)) {
3344 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3345 __Pyx_INCREF(__pyx_t_5);
3346 __Pyx_INCREF(
function);
3347 __Pyx_DECREF_SET(__pyx_t_3,
function);
3350 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3351 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3352 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
3353 __Pyx_GOTREF(__pyx_t_4);
3354 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3355 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 222, __pyx_L1_error)
3356 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3366 __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error))
3367 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
3368 __Pyx_GOTREF(__pyx_t_4);
3369 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 225, __pyx_L1_error)
3370 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3371 __pyx_t_1 = ((!__pyx_t_2) != 0);
3381 __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error))
3382 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error)
3383 __Pyx_GOTREF(__pyx_t_3);
3385 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3386 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3387 if (likely(__pyx_t_5)) {
3388 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3389 __Pyx_INCREF(__pyx_t_5);
3390 __Pyx_INCREF(
function);
3391 __Pyx_DECREF_SET(__pyx_t_3,
function);
3394 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3395 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3396 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
3397 __Pyx_GOTREF(__pyx_t_4);
3398 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3399 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3417 __Pyx_TraceLine(228,0,__PYX_ERR(0, 228, __pyx_L1_error))
3418 __pyx_t_2 = ((!(__pyx_v_B_is_identity != 0)) != 0);
3421 __pyx_t_1 = __pyx_t_2;
3422 goto __pyx_L14_bool_binop_done;
3424 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
3425 __Pyx_GOTREF(__pyx_t_4);
3426 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 228, __pyx_L1_error)
3427 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3428 __pyx_t_6 = ((!__pyx_t_2) != 0);
3429 __pyx_t_1 = __pyx_t_6;
3430 __pyx_L14_bool_binop_done:;
3440 __Pyx_TraceLine(229,0,__PYX_ERR(0, 229, __pyx_L1_error))
3441 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
3442 __Pyx_GOTREF(__pyx_t_3);
3444 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3445 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3446 if (likely(__pyx_t_5)) {
3447 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3448 __Pyx_INCREF(__pyx_t_5);
3449 __Pyx_INCREF(
function);
3450 __Pyx_DECREF_SET(__pyx_t_3,
function);
3453 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3454 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3455 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error)
3456 __Pyx_GOTREF(__pyx_t_4);
3457 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3458 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3476 __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error))
3477 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error)
3478 __Pyx_GOTREF(__pyx_t_4);
3479 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
3480 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3490 __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
3491 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
3492 __Pyx_GOTREF(__pyx_t_3);
3493 __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error)
3494 __Pyx_GOTREF(__pyx_t_5);
3497 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3498 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
3499 if (likely(__pyx_t_7)) {
3500 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3501 __Pyx_INCREF(__pyx_t_7);
3502 __Pyx_INCREF(
function);
3503 __Pyx_DECREF_SET(__pyx_t_3,
function);
3507 #if CYTHON_FAST_PYCALL
3508 if (PyFunction_Check(__pyx_t_3)) {
3509 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
3510 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
3511 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3512 __Pyx_GOTREF(__pyx_t_4);
3513 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3516 #if CYTHON_FAST_PYCCALL
3517 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3518 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
3519 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
3520 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3521 __Pyx_GOTREF(__pyx_t_4);
3522 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3526 __pyx_t_9 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error)
3527 __Pyx_GOTREF(__pyx_t_9);
3529 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
3531 __Pyx_INCREF(__pyx_v_A);
3532 __Pyx_GIVEREF(__pyx_v_A);
3533 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_A);
3534 __Pyx_INCREF(__pyx_v_B);
3535 __Pyx_GIVEREF(__pyx_v_B);
3536 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_B);
3537 __Pyx_GIVEREF(__pyx_t_5);
3538 PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
3540 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
3541 __Pyx_GOTREF(__pyx_t_4);
3542 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3544 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3545 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3564 __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error))
3565 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
3566 __Pyx_GOTREF(__pyx_t_4);
3567 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 235, __pyx_L1_error)
3568 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3578 __Pyx_TraceLine(236,0,__PYX_ERR(0, 236, __pyx_L1_error))
3579 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
3580 __Pyx_GOTREF(__pyx_t_3);
3581 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 236, __pyx_L1_error)
3582 __Pyx_GOTREF(__pyx_t_9);
3585 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3586 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3587 if (likely(__pyx_t_5)) {
3588 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3589 __Pyx_INCREF(__pyx_t_5);
3590 __Pyx_INCREF(
function);
3591 __Pyx_DECREF_SET(__pyx_t_3,
function);
3595 #if CYTHON_FAST_PYCALL
3596 if (PyFunction_Check(__pyx_t_3)) {
3597 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
3598 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
3599 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3600 __Pyx_GOTREF(__pyx_t_4);
3601 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3604 #if CYTHON_FAST_PYCCALL
3605 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3606 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
3607 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
3608 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3609 __Pyx_GOTREF(__pyx_t_4);
3610 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3614 __pyx_t_7 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error)
3615 __Pyx_GOTREF(__pyx_t_7);
3617 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
3619 __Pyx_INCREF(__pyx_v_A);
3620 __Pyx_GIVEREF(__pyx_v_A);
3621 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_A);
3622 __Pyx_INCREF(__pyx_v_B);
3623 __Pyx_GIVEREF(__pyx_v_B);
3624 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_B);
3625 __Pyx_GIVEREF(__pyx_t_9);
3626 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
3628 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
3629 __Pyx_GOTREF(__pyx_t_4);
3630 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3632 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3633 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3652 __Pyx_TraceLine(238,0,__PYX_ERR(0, 238, __pyx_L1_error))
3653 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error)
3654 __Pyx_GOTREF(__pyx_t_4);
3655 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 238, __pyx_L1_error)
3656 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3666 __Pyx_TraceLine(239,0,__PYX_ERR(0, 239, __pyx_L1_error))
3667 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
3668 __Pyx_GOTREF(__pyx_t_3);
3669 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error)
3670 __Pyx_GOTREF(__pyx_t_7);
3673 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3674 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
3675 if (likely(__pyx_t_9)) {
3676 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3677 __Pyx_INCREF(__pyx_t_9);
3678 __Pyx_INCREF(
function);
3679 __Pyx_DECREF_SET(__pyx_t_3,
function);
3683 #if CYTHON_FAST_PYCALL
3684 if (PyFunction_Check(__pyx_t_3)) {
3685 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
3686 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
3687 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3688 __Pyx_GOTREF(__pyx_t_4);
3689 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3692 #if CYTHON_FAST_PYCCALL
3693 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3694 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
3695 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
3696 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3697 __Pyx_GOTREF(__pyx_t_4);
3698 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3702 __pyx_t_5 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error)
3703 __Pyx_GOTREF(__pyx_t_5);
3705 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
3707 __Pyx_INCREF(__pyx_v_A);
3708 __Pyx_GIVEREF(__pyx_v_A);
3709 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_A);
3710 __Pyx_INCREF(__pyx_v_B);
3711 __Pyx_GIVEREF(__pyx_v_B);
3712 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_B);
3713 __Pyx_GIVEREF(__pyx_t_7);
3714 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
3716 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
3717 __Pyx_GOTREF(__pyx_t_4);
3718 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3720 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3721 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3750 __Pyx_TraceLine(241,0,__PYX_ERR(0, 241, __pyx_L1_error))
3751 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csc);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
3752 __Pyx_GOTREF(__pyx_t_3);
3754 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3755 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3756 if (likely(__pyx_t_5)) {
3757 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3758 __Pyx_INCREF(__pyx_t_5);
3759 __Pyx_INCREF(
function);
3760 __Pyx_DECREF_SET(__pyx_t_3,
function);
3763 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3764 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3765 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
3766 __Pyx_GOTREF(__pyx_t_4);
3767 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3768 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 241, __pyx_L1_error)
3769 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3779 __Pyx_TraceLine(244,0,__PYX_ERR(0, 244, __pyx_L1_error))
3780 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error)
3781 __Pyx_GOTREF(__pyx_t_4);
3782 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 244, __pyx_L1_error)
3783 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3784 __pyx_t_6 = ((!__pyx_t_1) != 0);
3794 __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error))
3795 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
3796 __Pyx_GOTREF(__pyx_t_3);
3798 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3799 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3800 if (likely(__pyx_t_5)) {
3801 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3802 __Pyx_INCREF(__pyx_t_5);
3803 __Pyx_INCREF(
function);
3804 __Pyx_DECREF_SET(__pyx_t_3,
function);
3807 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3808 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3809 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error)
3810 __Pyx_GOTREF(__pyx_t_4);
3811 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3812 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3830 __Pyx_TraceLine(247,0,__PYX_ERR(0, 247, __pyx_L1_error))
3831 __pyx_t_1 = ((!(__pyx_v_B_is_identity != 0)) != 0);
3834 __pyx_t_6 = __pyx_t_1;
3835 goto __pyx_L19_bool_binop_done;
3837 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error)
3838 __Pyx_GOTREF(__pyx_t_4);
3839 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 247, __pyx_L1_error)
3840 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3841 __pyx_t_2 = ((!__pyx_t_1) != 0);
3842 __pyx_t_6 = __pyx_t_2;
3843 __pyx_L19_bool_binop_done:;
3853 __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
3854 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
3855 __Pyx_GOTREF(__pyx_t_3);
3857 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3858 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3859 if (likely(__pyx_t_5)) {
3860 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3861 __Pyx_INCREF(__pyx_t_5);
3862 __Pyx_INCREF(
function);
3863 __Pyx_DECREF_SET(__pyx_t_3,
function);
3866 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3867 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3868 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
3869 __Pyx_GOTREF(__pyx_t_4);
3870 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3871 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3889 __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error))
3890 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
3891 __Pyx_GOTREF(__pyx_t_4);
3892 __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 251, __pyx_L1_error)
3893 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3903 __Pyx_TraceLine(252,0,__PYX_ERR(0, 252, __pyx_L1_error))
3904 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
3905 __Pyx_GOTREF(__pyx_t_3);
3906 __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
3907 __Pyx_GOTREF(__pyx_t_5);
3910 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3911 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
3912 if (likely(__pyx_t_7)) {
3913 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3914 __Pyx_INCREF(__pyx_t_7);
3915 __Pyx_INCREF(
function);
3916 __Pyx_DECREF_SET(__pyx_t_3,
function);
3920 #if CYTHON_FAST_PYCALL
3921 if (PyFunction_Check(__pyx_t_3)) {
3922 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
3923 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
3924 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3925 __Pyx_GOTREF(__pyx_t_4);
3926 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3929 #if CYTHON_FAST_PYCCALL
3930 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3931 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
3932 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
3933 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3934 __Pyx_GOTREF(__pyx_t_4);
3935 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3939 __pyx_t_9 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 252, __pyx_L1_error)
3940 __Pyx_GOTREF(__pyx_t_9);
3942 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
3944 __Pyx_INCREF(__pyx_v_A);
3945 __Pyx_GIVEREF(__pyx_v_A);
3946 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_A);
3947 __Pyx_INCREF(__pyx_v_B);
3948 __Pyx_GIVEREF(__pyx_v_B);
3949 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_B);
3950 __Pyx_GIVEREF(__pyx_t_5);
3951 PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
3953 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
3954 __Pyx_GOTREF(__pyx_t_4);
3955 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3957 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3958 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3977 __Pyx_TraceLine(254,0,__PYX_ERR(0, 254, __pyx_L1_error))
3978 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
3979 __Pyx_GOTREF(__pyx_t_4);
3980 __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 254, __pyx_L1_error)
3981 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3991 __Pyx_TraceLine(255,0,__PYX_ERR(0, 255, __pyx_L1_error))
3992 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error)
3993 __Pyx_GOTREF(__pyx_t_3);
3994 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 255, __pyx_L1_error)
3995 __Pyx_GOTREF(__pyx_t_9);
3998 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3999 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4000 if (likely(__pyx_t_5)) {
4001 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4002 __Pyx_INCREF(__pyx_t_5);
4003 __Pyx_INCREF(
function);
4004 __Pyx_DECREF_SET(__pyx_t_3,
function);
4008 #if CYTHON_FAST_PYCALL
4009 if (PyFunction_Check(__pyx_t_3)) {
4010 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
4011 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
4012 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4013 __Pyx_GOTREF(__pyx_t_4);
4014 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4017 #if CYTHON_FAST_PYCCALL
4018 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4019 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
4020 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
4021 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4022 __Pyx_GOTREF(__pyx_t_4);
4023 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4027 __pyx_t_7 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error)
4028 __Pyx_GOTREF(__pyx_t_7);
4030 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
4032 __Pyx_INCREF(__pyx_v_A);
4033 __Pyx_GIVEREF(__pyx_v_A);
4034 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_A);
4035 __Pyx_INCREF(__pyx_v_B);
4036 __Pyx_GIVEREF(__pyx_v_B);
4037 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_B);
4038 __Pyx_GIVEREF(__pyx_t_9);
4039 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
4041 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
4042 __Pyx_GOTREF(__pyx_t_4);
4043 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4045 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4046 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4065 __Pyx_TraceLine(257,0,__PYX_ERR(0, 257, __pyx_L1_error))
4066 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
4067 __Pyx_GOTREF(__pyx_t_4);
4068 __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 257, __pyx_L1_error)
4069 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4079 __Pyx_TraceLine(258,0,__PYX_ERR(0, 258, __pyx_L1_error))
4080 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
4081 __Pyx_GOTREF(__pyx_t_3);
4082 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error)
4083 __Pyx_GOTREF(__pyx_t_7);
4086 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4087 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
4088 if (likely(__pyx_t_9)) {
4089 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4090 __Pyx_INCREF(__pyx_t_9);
4091 __Pyx_INCREF(
function);
4092 __Pyx_DECREF_SET(__pyx_t_3,
function);
4096 #if CYTHON_FAST_PYCALL
4097 if (PyFunction_Check(__pyx_t_3)) {
4098 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
4099 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
4100 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4101 __Pyx_GOTREF(__pyx_t_4);
4102 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4105 #if CYTHON_FAST_PYCCALL
4106 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4107 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
4108 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
4109 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4110 __Pyx_GOTREF(__pyx_t_4);
4111 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4115 __pyx_t_5 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error)
4116 __Pyx_GOTREF(__pyx_t_5);
4118 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
4120 __Pyx_INCREF(__pyx_v_A);
4121 __Pyx_GIVEREF(__pyx_v_A);
4122 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_A);
4123 __Pyx_INCREF(__pyx_v_B);
4124 __Pyx_GIVEREF(__pyx_v_B);
4125 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_B);
4126 __Pyx_GIVEREF(__pyx_t_7);
4127 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
4129 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
4130 __Pyx_GOTREF(__pyx_t_4);
4131 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4133 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4134 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4163 __Pyx_TraceLine(263,0,__PYX_ERR(0, 263, __pyx_L1_error))
4165 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
4166 __Pyx_GOTREF(__pyx_t_3);
4168 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4169 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4170 if (likely(__pyx_t_5)) {
4171 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4172 __Pyx_INCREF(__pyx_t_5);
4173 __Pyx_INCREF(
function);
4174 __Pyx_DECREF_SET(__pyx_t_3,
function);
4177 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4178 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4179 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
4180 __Pyx_GOTREF(__pyx_t_4);
4181 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4182 __Pyx_GIVEREF(__pyx_t_4);
4183 __Pyx_GOTREF(__pyx_v_self->A_csr);
4184 __Pyx_DECREF(__pyx_v_self->A_csr);
4185 __pyx_v_self->A_csr = __pyx_t_4;
4195 __Pyx_TraceLine(265,0,__PYX_ERR(0, 265, __pyx_L1_error))
4196 __pyx_t_6 = ((!(__pyx_v_B_is_identity != 0)) != 0);
4206 __Pyx_TraceLine(266,0,__PYX_ERR(0, 266, __pyx_L1_error))
4207 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
4208 __Pyx_GOTREF(__pyx_t_3);
4210 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4211 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4212 if (likely(__pyx_t_5)) {
4213 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4214 __Pyx_INCREF(__pyx_t_5);
4215 __Pyx_INCREF(
function);
4216 __Pyx_DECREF_SET(__pyx_t_3,
function);
4219 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_B) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_B);
4220 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4221 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
4222 __Pyx_GOTREF(__pyx_t_4);
4223 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4224 __Pyx_GIVEREF(__pyx_t_4);
4225 __Pyx_GOTREF(__pyx_v_self->B_csr);
4226 __Pyx_DECREF(__pyx_v_self->B_csr);
4227 __pyx_v_self->B_csr = __pyx_t_4;
4247 __Pyx_TraceLine(268,0,__PYX_ERR(0, 268, __pyx_L1_error))
4249 __Pyx_INCREF(__pyx_v_B);
4250 __Pyx_GIVEREF(__pyx_v_B);
4251 __Pyx_GOTREF(__pyx_v_self->B_csr);
4252 __Pyx_DECREF(__pyx_v_self->B_csr);
4253 __pyx_v_self->B_csr = __pyx_v_B;
4264 __Pyx_TraceLine(271,0,__PYX_ERR(0, 271, __pyx_L1_error))
4265 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
4266 __Pyx_GOTREF(__pyx_t_4);
4267 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
4268 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4269 __pyx_t_2 = ((!__pyx_t_6) != 0);
4279 __Pyx_TraceLine(272,0,__PYX_ERR(0, 272, __pyx_L1_error))
4280 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
4281 __Pyx_GOTREF(__pyx_t_3);
4283 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4284 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4285 if (likely(__pyx_t_5)) {
4286 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4287 __Pyx_INCREF(__pyx_t_5);
4288 __Pyx_INCREF(
function);
4289 __Pyx_DECREF_SET(__pyx_t_3,
function);
4292 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4293 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4294 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
4295 __Pyx_GOTREF(__pyx_t_4);
4296 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4297 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4315 __Pyx_TraceLine(274,0,__PYX_ERR(0, 274, __pyx_L1_error))
4316 __pyx_t_6 = ((!(__pyx_v_B_is_identity != 0)) != 0);
4319 __pyx_t_2 = __pyx_t_6;
4320 goto __pyx_L25_bool_binop_done;
4322 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->B_csr, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
4323 __Pyx_GOTREF(__pyx_t_4);
4324 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 274, __pyx_L1_error)
4325 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4326 __pyx_t_1 = ((!__pyx_t_6) != 0);
4327 __pyx_t_2 = __pyx_t_1;
4328 __pyx_L25_bool_binop_done:;
4338 __Pyx_TraceLine(275,0,__PYX_ERR(0, 275, __pyx_L1_error))
4339 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->B_csr, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
4340 __Pyx_GOTREF(__pyx_t_3);
4342 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4343 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4344 if (likely(__pyx_t_5)) {
4345 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4346 __Pyx_INCREF(__pyx_t_5);
4347 __Pyx_INCREF(
function);
4348 __Pyx_DECREF_SET(__pyx_t_3,
function);
4351 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4352 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4353 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error)
4354 __Pyx_GOTREF(__pyx_t_4);
4355 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4356 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4374 __Pyx_TraceLine(278,0,__PYX_ERR(0, 278, __pyx_L1_error))
4375 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
4376 __Pyx_GOTREF(__pyx_t_4);
4377 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
4378 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4388 __Pyx_TraceLine(279,0,__PYX_ERR(0, 279, __pyx_L1_error))
4389 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
4390 __Pyx_GOTREF(__pyx_t_3);
4399 __Pyx_TraceLine(280,0,__PYX_ERR(0, 280, __pyx_L1_error))
4400 __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
4401 __Pyx_GOTREF(__pyx_t_5);
4404 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4405 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4406 if (likely(__pyx_t_7)) {
4407 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4408 __Pyx_INCREF(__pyx_t_7);
4409 __Pyx_INCREF(
function);
4410 __Pyx_DECREF_SET(__pyx_t_3,
function);
4414 #if CYTHON_FAST_PYCALL
4415 if (PyFunction_Check(__pyx_t_3)) {
4416 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_5};
4417 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
4418 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4419 __Pyx_GOTREF(__pyx_t_4);
4420 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4423 #if CYTHON_FAST_PYCCALL
4424 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4425 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_5};
4426 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
4427 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4428 __Pyx_GOTREF(__pyx_t_4);
4429 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4433 __pyx_t_9 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 279, __pyx_L1_error)
4434 __Pyx_GOTREF(__pyx_t_9);
4436 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
4438 __Pyx_INCREF(__pyx_v_self->A_csr);
4439 __Pyx_GIVEREF(__pyx_v_self->A_csr);
4440 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_self->A_csr);
4441 __Pyx_INCREF(__pyx_v_self->B_csr);
4442 __Pyx_GIVEREF(__pyx_v_self->B_csr);
4443 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_self->B_csr);
4444 __Pyx_GIVEREF(__pyx_t_5);
4445 PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
4447 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
4448 __Pyx_GOTREF(__pyx_t_4);
4449 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4451 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4452 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4471 __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error))
4472 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
4473 __Pyx_GOTREF(__pyx_t_4);
4474 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 282, __pyx_L1_error)
4475 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4485 __Pyx_TraceLine(283,0,__PYX_ERR(0, 283, __pyx_L1_error))
4486 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
4487 __Pyx_GOTREF(__pyx_t_3);
4496 __Pyx_TraceLine(284,0,__PYX_ERR(0, 284, __pyx_L1_error))
4497 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 284, __pyx_L1_error)
4498 __Pyx_GOTREF(__pyx_t_9);
4501 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4502 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4503 if (likely(__pyx_t_5)) {
4504 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4505 __Pyx_INCREF(__pyx_t_5);
4506 __Pyx_INCREF(
function);
4507 __Pyx_DECREF_SET(__pyx_t_3,
function);
4511 #if CYTHON_FAST_PYCALL
4512 if (PyFunction_Check(__pyx_t_3)) {
4513 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_9};
4514 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
4515 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4516 __Pyx_GOTREF(__pyx_t_4);
4517 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4520 #if CYTHON_FAST_PYCCALL
4521 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4522 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_9};
4523 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
4524 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4525 __Pyx_GOTREF(__pyx_t_4);
4526 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4530 __pyx_t_7 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error)
4531 __Pyx_GOTREF(__pyx_t_7);
4533 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
4535 __Pyx_INCREF(__pyx_v_self->A_csr);
4536 __Pyx_GIVEREF(__pyx_v_self->A_csr);
4537 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_self->A_csr);
4538 __Pyx_INCREF(__pyx_v_self->B_csr);
4539 __Pyx_GIVEREF(__pyx_v_self->B_csr);
4540 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_self->B_csr);
4541 __Pyx_GIVEREF(__pyx_t_9);
4542 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
4544 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
4545 __Pyx_GOTREF(__pyx_t_4);
4546 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4548 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4549 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4568 __Pyx_TraceLine(286,0,__PYX_ERR(0, 286, __pyx_L1_error))
4569 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
4570 __Pyx_GOTREF(__pyx_t_4);
4571 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
4572 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4582 __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error))
4583 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
4584 __Pyx_GOTREF(__pyx_t_3);
4593 __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error))
4594 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error)
4595 __Pyx_GOTREF(__pyx_t_7);
4598 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4599 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
4600 if (likely(__pyx_t_9)) {
4601 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4602 __Pyx_INCREF(__pyx_t_9);
4603 __Pyx_INCREF(
function);
4604 __Pyx_DECREF_SET(__pyx_t_3,
function);
4608 #if CYTHON_FAST_PYCALL
4609 if (PyFunction_Check(__pyx_t_3)) {
4610 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_7};
4611 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
4612 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4613 __Pyx_GOTREF(__pyx_t_4);
4614 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4617 #if CYTHON_FAST_PYCCALL
4618 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4619 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_7};
4620 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
4621 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4622 __Pyx_GOTREF(__pyx_t_4);
4623 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4627 __pyx_t_5 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error)
4628 __Pyx_GOTREF(__pyx_t_5);
4630 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
4632 __Pyx_INCREF(__pyx_v_self->A_csr);
4633 __Pyx_GIVEREF(__pyx_v_self->A_csr);
4634 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_self->A_csr);
4635 __Pyx_INCREF(__pyx_v_self->B_csr);
4636 __Pyx_GIVEREF(__pyx_v_self->B_csr);
4637 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_self->B_csr);
4638 __Pyx_GIVEREF(__pyx_t_7);
4639 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
4641 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
4642 __Pyx_GOTREF(__pyx_t_4);
4643 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4645 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4646 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4677 __Pyx_TraceLine(293,0,__PYX_ERR(0, 293, __pyx_L1_error))
4679 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error)
4680 __Pyx_GOTREF(__pyx_t_4);
4681 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 293, __pyx_L1_error)
4682 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4692 __Pyx_TraceLine(294,0,__PYX_ERR(0, 294, __pyx_L1_error))
4693 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
4694 __Pyx_GOTREF(__pyx_t_3);
4695 __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 294, __pyx_L1_error)
4696 __Pyx_GOTREF(__pyx_t_5);
4699 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4700 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4701 if (likely(__pyx_t_7)) {
4702 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4703 __Pyx_INCREF(__pyx_t_7);
4704 __Pyx_INCREF(
function);
4705 __Pyx_DECREF_SET(__pyx_t_3,
function);
4709 #if CYTHON_FAST_PYCALL
4710 if (PyFunction_Check(__pyx_t_3)) {
4711 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
4712 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
4713 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4714 __Pyx_GOTREF(__pyx_t_4);
4715 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4718 #if CYTHON_FAST_PYCCALL
4719 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4720 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
4721 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
4722 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4723 __Pyx_GOTREF(__pyx_t_4);
4724 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4728 __pyx_t_9 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 294, __pyx_L1_error)
4729 __Pyx_GOTREF(__pyx_t_9);
4731 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
4733 __Pyx_INCREF(__pyx_v_A);
4734 __Pyx_GIVEREF(__pyx_v_A);
4735 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_A);
4736 __Pyx_INCREF(__pyx_v_B);
4737 __Pyx_GIVEREF(__pyx_v_B);
4738 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_B);
4739 __Pyx_GIVEREF(__pyx_t_5);
4740 PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
4742 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
4743 __Pyx_GOTREF(__pyx_t_4);
4744 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4746 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4747 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4766 __Pyx_TraceLine(296,0,__PYX_ERR(0, 296, __pyx_L1_error))
4767 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error)
4768 __Pyx_GOTREF(__pyx_t_4);
4769 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 296, __pyx_L1_error)
4770 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4780 __Pyx_TraceLine(297,0,__PYX_ERR(0, 297, __pyx_L1_error))
4781 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
4782 __Pyx_GOTREF(__pyx_t_3);
4783 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 297, __pyx_L1_error)
4784 __Pyx_GOTREF(__pyx_t_9);
4787 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4788 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4789 if (likely(__pyx_t_5)) {
4790 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4791 __Pyx_INCREF(__pyx_t_5);
4792 __Pyx_INCREF(
function);
4793 __Pyx_DECREF_SET(__pyx_t_3,
function);
4797 #if CYTHON_FAST_PYCALL
4798 if (PyFunction_Check(__pyx_t_3)) {
4799 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
4800 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
4801 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4802 __Pyx_GOTREF(__pyx_t_4);
4803 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4806 #if CYTHON_FAST_PYCCALL
4807 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4808 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
4809 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
4810 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4811 __Pyx_GOTREF(__pyx_t_4);
4812 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4816 __pyx_t_7 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error)
4817 __Pyx_GOTREF(__pyx_t_7);
4819 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
4821 __Pyx_INCREF(__pyx_v_A);
4822 __Pyx_GIVEREF(__pyx_v_A);
4823 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_A);
4824 __Pyx_INCREF(__pyx_v_B);
4825 __Pyx_GIVEREF(__pyx_v_B);
4826 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_B);
4827 __Pyx_GIVEREF(__pyx_t_9);
4828 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
4830 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
4831 __Pyx_GOTREF(__pyx_t_4);
4832 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4834 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4835 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4854 __Pyx_TraceLine(299,0,__PYX_ERR(0, 299, __pyx_L1_error))
4855 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
4856 __Pyx_GOTREF(__pyx_t_4);
4857 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 299, __pyx_L1_error)
4858 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4868 __Pyx_TraceLine(300,0,__PYX_ERR(0, 300, __pyx_L1_error))
4869 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
4870 __Pyx_GOTREF(__pyx_t_3);
4871 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 300, __pyx_L1_error)
4872 __Pyx_GOTREF(__pyx_t_7);
4875 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4876 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
4877 if (likely(__pyx_t_9)) {
4878 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4879 __Pyx_INCREF(__pyx_t_9);
4880 __Pyx_INCREF(
function);
4881 __Pyx_DECREF_SET(__pyx_t_3,
function);
4885 #if CYTHON_FAST_PYCALL
4886 if (PyFunction_Check(__pyx_t_3)) {
4887 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
4888 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
4889 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4890 __Pyx_GOTREF(__pyx_t_4);
4891 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4894 #if CYTHON_FAST_PYCCALL
4895 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4896 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
4897 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
4898 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4899 __Pyx_GOTREF(__pyx_t_4);
4900 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4904 __pyx_t_5 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
4905 __Pyx_GOTREF(__pyx_t_5);
4907 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
4909 __Pyx_INCREF(__pyx_v_A);
4910 __Pyx_GIVEREF(__pyx_v_A);
4911 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_A);
4912 __Pyx_INCREF(__pyx_v_B);
4913 __Pyx_GIVEREF(__pyx_v_B);
4914 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_B);
4915 __Pyx_GIVEREF(__pyx_t_7);
4916 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
4918 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
4919 __Pyx_GOTREF(__pyx_t_4);
4920 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4922 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4923 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4949 __Pyx_XDECREF(__pyx_t_3);
4950 __Pyx_XDECREF(__pyx_t_4);
4951 __Pyx_XDECREF(__pyx_t_5);
4952 __Pyx_XDECREF(__pyx_t_7);
4953 __Pyx_XDECREF(__pyx_t_9);
4954 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4957 __Pyx_TraceReturn(Py_None, 0);
4958 __Pyx_RefNannyFinishContext();
4971 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4972 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float[] =
"pycAffineMatrixFunction.set_dense_matrix_float(self, A, B, B_is_identity)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4973 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float = {
"set_dense_matrix_float", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float};
4974 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4975 PyObject *__pyx_v_A = 0;
4976 PyObject *__pyx_v_B = 0;
4977 PyObject *__pyx_v_B_is_identity = 0;
4978 int __pyx_lineno = 0;
4979 const char *__pyx_filename = NULL;
4980 int __pyx_clineno = 0;
4981 PyObject *__pyx_r = 0;
4982 __Pyx_RefNannyDeclarations
4983 __Pyx_RefNannySetupContext(
"set_dense_matrix_float (wrapper)", 0);
4985 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
4986 PyObject* values[3] = {0,0,0};
4987 if (unlikely(__pyx_kwds)) {
4989 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4991 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4993 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4995 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4998 default:
goto __pyx_L5_argtuple_error;
5000 kw_args = PyDict_Size(__pyx_kwds);
5003 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5004 else goto __pyx_L5_argtuple_error;
5007 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
5009 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_float", 1, 3, 3, 1); __PYX_ERR(0, 306, __pyx_L3_error)
5013 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
5015 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_float", 1, 3, 3, 2); __PYX_ERR(0, 306, __pyx_L3_error)
5018 if (unlikely(kw_args > 0)) {
5019 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_dense_matrix_float") < 0)) __PYX_ERR(0, 306, __pyx_L3_error)
5021 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5022 goto __pyx_L5_argtuple_error;
5024 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5025 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5026 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5028 __pyx_v_A = values[0];
5029 __pyx_v_B = values[1];
5030 __pyx_v_B_is_identity = values[2];
5032 goto __pyx_L4_argument_unpacking_done;
5033 __pyx_L5_argtuple_error:;
5034 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_float", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 306, __pyx_L3_error)
5036 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5037 __Pyx_RefNannyFinishContext();
5039 __pyx_L4_argument_unpacking_done:;
5040 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
5043 __Pyx_RefNannyFinishContext();
5047 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
5048 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5049 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5050 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
5051 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_B_is_row_major;
5052 __Pyx_memviewslice __pyx_v_A_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5053 __Pyx_memviewslice __pyx_v_A_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5054 __Pyx_memviewslice __pyx_v_B_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5055 __Pyx_memviewslice __pyx_v_B_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5056 float *__pyx_v_A_data;
5057 float *__pyx_v_B_data;
5058 PyObject *__pyx_r = NULL;
5059 __Pyx_TraceDeclarations
5060 __Pyx_RefNannyDeclarations
5061 PyObject *__pyx_t_1 = NULL;
5062 PyObject *__pyx_t_2 = NULL;
5063 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5066 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5067 __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
5068 Py_ssize_t __pyx_t_8;
5069 Py_ssize_t __pyx_t_9;
5071 int __pyx_lineno = 0;
5072 const char *__pyx_filename = NULL;
5073 int __pyx_clineno = 0;
5074 __Pyx_TraceFrameInit(__pyx_codeobj__7)
5075 __Pyx_RefNannySetupContext(
"set_dense_matrix_float", 0);
5076 __Pyx_TraceCall(
"set_dense_matrix_float", __pyx_f[0], 306, 0, __PYX_ERR(0, 306, __pyx_L1_error));
5085 __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error))
5086 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
5087 __Pyx_GOTREF(__pyx_t_1);
5088 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error)
5089 __Pyx_GOTREF(__pyx_t_2);
5090 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5091 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L1_error)
5092 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5093 __pyx_v_A_num_rows = __pyx_t_3;
5102 __Pyx_TraceLine(316,0,__PYX_ERR(0, 316, __pyx_L1_error))
5103 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
5104 __Pyx_GOTREF(__pyx_t_2);
5105 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
5106 __Pyx_GOTREF(__pyx_t_1);
5107 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5108 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L1_error)
5109 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5110 __pyx_v_A_num_columns = __pyx_t_3;
5119 __Pyx_TraceLine(320,0,__PYX_ERR(0, 320, __pyx_L1_error))
5120 __pyx_v_B_is_row_major = 0;
5129 __Pyx_TraceLine(322,0,__PYX_ERR(0, 322, __pyx_L1_error))
5130 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
5131 __Pyx_GOTREF(__pyx_t_1);
5132 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
5133 __Pyx_GOTREF(__pyx_t_2);
5134 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5135 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 322, __pyx_L1_error)
5136 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5146 __Pyx_TraceLine(323,0,__PYX_ERR(0, 323, __pyx_L1_error))
5147 __pyx_v_A_is_row_major = 1;
5166 __Pyx_TraceLine(324,0,__PYX_ERR(0, 324, __pyx_L1_error))
5167 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
5168 __Pyx_GOTREF(__pyx_t_2);
5169 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
5170 __Pyx_GOTREF(__pyx_t_1);
5171 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5172 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 324, __pyx_L1_error)
5173 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5174 if (likely(__pyx_t_4)) {
5183 __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error))
5184 __pyx_v_A_is_row_major = 0;
5203 __Pyx_TraceLine(327,0,__PYX_ERR(0, 327, __pyx_L1_error))
5205 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
5206 __Pyx_GOTREF(__pyx_t_1);
5207 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5208 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5209 __PYX_ERR(0, 327, __pyx_L1_error)
5220 __Pyx_TraceLine(329,0,__PYX_ERR(0, 329, __pyx_L1_error))
5221 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 329, __pyx_L1_error)
5222 __pyx_t_5 = ((!__pyx_t_4) != 0);
5232 __Pyx_TraceLine(330,0,__PYX_ERR(0, 330, __pyx_L1_error))
5233 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
5234 __Pyx_GOTREF(__pyx_t_1);
5235 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
5236 __Pyx_GOTREF(__pyx_t_2);
5237 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5238 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 330, __pyx_L1_error)
5239 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5249 __Pyx_TraceLine(331,0,__PYX_ERR(0, 331, __pyx_L1_error))
5250 __pyx_v_B_is_row_major = 1;
5269 __Pyx_TraceLine(332,0,__PYX_ERR(0, 332, __pyx_L1_error))
5270 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
5271 __Pyx_GOTREF(__pyx_t_2);
5272 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
5273 __Pyx_GOTREF(__pyx_t_1);
5274 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5275 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
5276 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5277 if (likely(__pyx_t_5)) {
5286 __Pyx_TraceLine(333,0,__PYX_ERR(0, 333, __pyx_L1_error))
5287 __pyx_v_B_is_row_major = 0;
5306 __Pyx_TraceLine(335,0,__PYX_ERR(0, 335, __pyx_L1_error))
5308 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error)
5309 __Pyx_GOTREF(__pyx_t_1);
5310 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5311 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5312 __PYX_ERR(0, 335, __pyx_L1_error)
5332 __Pyx_TraceLine(340,0,__PYX_ERR(0, 340, __pyx_L1_error))
5333 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 340, __pyx_L1_error)
5334 __pyx_v_B_data_mv_c = __pyx_t_6;
5335 __pyx_t_6.memview = NULL;
5336 __pyx_t_6.data = NULL;
5345 __Pyx_TraceLine(341,0,__PYX_ERR(0, 341, __pyx_L1_error))
5346 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 341, __pyx_L1_error)
5347 __pyx_v_B_data_mv_f = __pyx_t_7;
5348 __pyx_t_7.memview = NULL;
5349 __pyx_t_7.data = NULL;
5358 __Pyx_TraceLine(345,0,__PYX_ERR(0, 345, __pyx_L1_error))
5359 __pyx_v_B_data = NULL;
5368 __Pyx_TraceLine(348,0,__PYX_ERR(0, 348, __pyx_L1_error))
5369 __pyx_t_5 = (__pyx_v_A_is_row_major != 0);
5379 __Pyx_TraceLine(351,0,__PYX_ERR(0, 351, __pyx_L1_error))
5380 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 351, __pyx_L1_error)
5381 __pyx_v_A_data_mv_c = __pyx_t_6;
5382 __pyx_t_6.memview = NULL;
5383 __pyx_t_6.data = NULL;
5392 __Pyx_TraceLine(354,0,__PYX_ERR(0, 354, __pyx_L1_error))
5395 __pyx_v_A_data = (&(*((
float *) ( ((
char *) (((
float *) ( (__pyx_v_A_data_mv_c.data + __pyx_t_8 * __pyx_v_A_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
5414 __Pyx_TraceLine(359,0,__PYX_ERR(0, 359, __pyx_L1_error))
5416 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 359, __pyx_L1_error)
5417 __pyx_v_A_data_mv_f = __pyx_t_7;
5418 __pyx_t_7.memview = NULL;
5419 __pyx_t_7.data = NULL;
5428 __Pyx_TraceLine(362,0,__PYX_ERR(0, 362, __pyx_L1_error))
5431 __pyx_v_A_data = (&(*((
float *) ( (( ((
char *) (((
float *) __pyx_v_A_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_A_data_mv_f.strides[1]) ))));
5442 __Pyx_TraceLine(365,0,__PYX_ERR(0, 365, __pyx_L1_error))
5443 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
5444 __pyx_t_4 = ((!__pyx_t_5) != 0);
5454 __Pyx_TraceLine(366,0,__PYX_ERR(0, 366, __pyx_L1_error))
5455 __pyx_t_4 = (__pyx_v_B_is_row_major != 0);
5465 __Pyx_TraceLine(369,0,__PYX_ERR(0, 369, __pyx_L1_error))
5466 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_B, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 369, __pyx_L1_error)
5467 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
5468 __pyx_v_B_data_mv_c = __pyx_t_6;
5469 __pyx_t_6.memview = NULL;
5470 __pyx_t_6.data = NULL;
5479 __Pyx_TraceLine(372,0,__PYX_ERR(0, 372, __pyx_L1_error))
5482 __pyx_v_B_data = (&(*((
float *) ( ((
char *) (((
float *) ( (__pyx_v_B_data_mv_c.data + __pyx_t_8 * __pyx_v_B_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
5501 __Pyx_TraceLine(377,0,__PYX_ERR(0, 377, __pyx_L1_error))
5503 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_B, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 377, __pyx_L1_error)
5504 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
5505 __pyx_v_B_data_mv_f = __pyx_t_7;
5506 __pyx_t_7.memview = NULL;
5507 __pyx_t_7.data = NULL;
5516 __Pyx_TraceLine(380,0,__PYX_ERR(0, 380, __pyx_L1_error))
5519 __pyx_v_B_data = (&(*((
float *) ( (( ((
char *) (((
float *) __pyx_v_B_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_B_data_mv_f.strides[1]) ))));
5539 __Pyx_TraceLine(383,0,__PYX_ERR(0, 383, __pyx_L1_error))
5540 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 383, __pyx_L1_error)
5550 __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error))
5554 __Pyx_CppExn2PyErr();
5555 __PYX_ERR(0, 384, __pyx_L1_error)
5557 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_10;
5576 __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
5586 __Pyx_TraceLine(396,0,__PYX_ERR(0, 396, __pyx_L1_error))
5588 __pyx_t_10 =
new cDenseAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_is_row_major);
5590 __Pyx_CppExn2PyErr();
5591 __PYX_ERR(0, 390, __pyx_L1_error)
5601 __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
5602 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_10;
5615 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5618 __Pyx_XDECREF(__pyx_t_1);
5619 __Pyx_XDECREF(__pyx_t_2);
5620 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5621 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
5622 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5625 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_c, 1);
5626 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_f, 1);
5627 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
5628 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
5629 __Pyx_XGIVEREF(__pyx_r);
5630 __Pyx_TraceReturn(__pyx_r, 0);
5631 __Pyx_RefNannyFinishContext();
5644 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5645 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double[] =
"pycAffineMatrixFunction.set_dense_matrix_double(self, A, B, B_is_identity)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
5646 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double = {
"set_dense_matrix_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double};
5647 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5648 PyObject *__pyx_v_A = 0;
5649 PyObject *__pyx_v_B = 0;
5650 PyObject *__pyx_v_B_is_identity = 0;
5651 int __pyx_lineno = 0;
5652 const char *__pyx_filename = NULL;
5653 int __pyx_clineno = 0;
5654 PyObject *__pyx_r = 0;
5655 __Pyx_RefNannyDeclarations
5656 __Pyx_RefNannySetupContext(
"set_dense_matrix_double (wrapper)", 0);
5658 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
5659 PyObject* values[3] = {0,0,0};
5660 if (unlikely(__pyx_kwds)) {
5662 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5664 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5666 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5668 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5671 default:
goto __pyx_L5_argtuple_error;
5673 kw_args = PyDict_Size(__pyx_kwds);
5676 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5677 else goto __pyx_L5_argtuple_error;
5680 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
5682 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_double", 1, 3, 3, 1); __PYX_ERR(0, 402, __pyx_L3_error)
5686 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
5688 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_double", 1, 3, 3, 2); __PYX_ERR(0, 402, __pyx_L3_error)
5691 if (unlikely(kw_args > 0)) {
5692 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_dense_matrix_double") < 0)) __PYX_ERR(0, 402, __pyx_L3_error)
5694 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5695 goto __pyx_L5_argtuple_error;
5697 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5698 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5699 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5701 __pyx_v_A = values[0];
5702 __pyx_v_B = values[1];
5703 __pyx_v_B_is_identity = values[2];
5705 goto __pyx_L4_argument_unpacking_done;
5706 __pyx_L5_argtuple_error:;
5707 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 402, __pyx_L3_error)
5709 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5710 __Pyx_RefNannyFinishContext();
5712 __pyx_L4_argument_unpacking_done:;
5713 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
5716 __Pyx_RefNannyFinishContext();
5720 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
5721 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5722 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5723 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
5724 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_B_is_row_major;
5725 __Pyx_memviewslice __pyx_v_A_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5726 __Pyx_memviewslice __pyx_v_A_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5727 __Pyx_memviewslice __pyx_v_B_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5728 __Pyx_memviewslice __pyx_v_B_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5729 double *__pyx_v_A_data;
5730 double *__pyx_v_B_data;
5731 PyObject *__pyx_r = NULL;
5732 __Pyx_TraceDeclarations
5733 __Pyx_RefNannyDeclarations
5734 PyObject *__pyx_t_1 = NULL;
5735 PyObject *__pyx_t_2 = NULL;
5736 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5739 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5740 __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
5741 Py_ssize_t __pyx_t_8;
5742 Py_ssize_t __pyx_t_9;
5744 int __pyx_lineno = 0;
5745 const char *__pyx_filename = NULL;
5746 int __pyx_clineno = 0;
5747 __Pyx_TraceFrameInit(__pyx_codeobj__10)
5748 __Pyx_RefNannySetupContext(
"set_dense_matrix_double", 0);
5749 __Pyx_TraceCall(
"set_dense_matrix_double", __pyx_f[0], 402, 0, __PYX_ERR(0, 402, __pyx_L1_error));
5758 __Pyx_TraceLine(411,0,__PYX_ERR(0, 411, __pyx_L1_error))
5759 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
5760 __Pyx_GOTREF(__pyx_t_1);
5761 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
5762 __Pyx_GOTREF(__pyx_t_2);
5763 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5764 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error)
5765 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5766 __pyx_v_A_num_rows = __pyx_t_3;
5775 __Pyx_TraceLine(412,0,__PYX_ERR(0, 412, __pyx_L1_error))
5776 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
5777 __Pyx_GOTREF(__pyx_t_2);
5778 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error)
5779 __Pyx_GOTREF(__pyx_t_1);
5780 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5781 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
5782 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5783 __pyx_v_A_num_columns = __pyx_t_3;
5792 __Pyx_TraceLine(416,0,__PYX_ERR(0, 416, __pyx_L1_error))
5793 __pyx_v_B_is_row_major = 0;
5802 __Pyx_TraceLine(418,0,__PYX_ERR(0, 418, __pyx_L1_error))
5803 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
5804 __Pyx_GOTREF(__pyx_t_1);
5805 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
5806 __Pyx_GOTREF(__pyx_t_2);
5807 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5808 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 418, __pyx_L1_error)
5809 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5819 __Pyx_TraceLine(419,0,__PYX_ERR(0, 419, __pyx_L1_error))
5820 __pyx_v_A_is_row_major = 1;
5839 __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error))
5840 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
5841 __Pyx_GOTREF(__pyx_t_2);
5842 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
5843 __Pyx_GOTREF(__pyx_t_1);
5844 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5845 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 420, __pyx_L1_error)
5846 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5847 if (likely(__pyx_t_4)) {
5856 __Pyx_TraceLine(421,0,__PYX_ERR(0, 421, __pyx_L1_error))
5857 __pyx_v_A_is_row_major = 0;
5876 __Pyx_TraceLine(423,0,__PYX_ERR(0, 423, __pyx_L1_error))
5878 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
5879 __Pyx_GOTREF(__pyx_t_1);
5880 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5881 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5882 __PYX_ERR(0, 423, __pyx_L1_error)
5893 __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error))
5894 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 425, __pyx_L1_error)
5895 __pyx_t_5 = ((!__pyx_t_4) != 0);
5905 __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error))
5906 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
5907 __Pyx_GOTREF(__pyx_t_1);
5908 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
5909 __Pyx_GOTREF(__pyx_t_2);
5910 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5911 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 426, __pyx_L1_error)
5912 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5922 __Pyx_TraceLine(427,0,__PYX_ERR(0, 427, __pyx_L1_error))
5923 __pyx_v_B_is_row_major = 1;
5942 __Pyx_TraceLine(428,0,__PYX_ERR(0, 428, __pyx_L1_error))
5943 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
5944 __Pyx_GOTREF(__pyx_t_2);
5945 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
5946 __Pyx_GOTREF(__pyx_t_1);
5947 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5948 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 428, __pyx_L1_error)
5949 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5950 if (likely(__pyx_t_5)) {
5959 __Pyx_TraceLine(429,0,__PYX_ERR(0, 429, __pyx_L1_error))
5960 __pyx_v_B_is_row_major = 0;
5979 __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error))
5981 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
5982 __Pyx_GOTREF(__pyx_t_1);
5983 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5984 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5985 __PYX_ERR(0, 431, __pyx_L1_error)
6005 __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error))
6006 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 436, __pyx_L1_error)
6007 __pyx_v_B_data_mv_c = __pyx_t_6;
6008 __pyx_t_6.memview = NULL;
6009 __pyx_t_6.data = NULL;
6018 __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error))
6019 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 437, __pyx_L1_error)
6020 __pyx_v_B_data_mv_f = __pyx_t_7;
6021 __pyx_t_7.memview = NULL;
6022 __pyx_t_7.data = NULL;
6031 __Pyx_TraceLine(441,0,__PYX_ERR(0, 441, __pyx_L1_error))
6032 __pyx_v_B_data = NULL;
6041 __Pyx_TraceLine(444,0,__PYX_ERR(0, 444, __pyx_L1_error))
6042 __pyx_t_5 = (__pyx_v_A_is_row_major != 0);
6052 __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error))
6053 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 447, __pyx_L1_error)
6054 __pyx_v_A_data_mv_c = __pyx_t_6;
6055 __pyx_t_6.memview = NULL;
6056 __pyx_t_6.data = NULL;
6065 __Pyx_TraceLine(450,0,__PYX_ERR(0, 450, __pyx_L1_error))
6068 __pyx_v_A_data = (&(*((
double *) ( ((
char *) (((
double *) ( (__pyx_v_A_data_mv_c.data + __pyx_t_8 * __pyx_v_A_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6087 __Pyx_TraceLine(455,0,__PYX_ERR(0, 455, __pyx_L1_error))
6089 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 455, __pyx_L1_error)
6090 __pyx_v_A_data_mv_f = __pyx_t_7;
6091 __pyx_t_7.memview = NULL;
6092 __pyx_t_7.data = NULL;
6101 __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
6104 __pyx_v_A_data = (&(*((
double *) ( (( ((
char *) (((
double *) __pyx_v_A_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_A_data_mv_f.strides[1]) ))));
6115 __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error))
6116 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 461, __pyx_L1_error)
6117 __pyx_t_4 = ((!__pyx_t_5) != 0);
6127 __Pyx_TraceLine(462,0,__PYX_ERR(0, 462, __pyx_L1_error))
6128 __pyx_t_4 = (__pyx_v_B_is_row_major != 0);
6138 __Pyx_TraceLine(465,0,__PYX_ERR(0, 465, __pyx_L1_error))
6139 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_B, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 465, __pyx_L1_error)
6140 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
6141 __pyx_v_B_data_mv_c = __pyx_t_6;
6142 __pyx_t_6.memview = NULL;
6143 __pyx_t_6.data = NULL;
6152 __Pyx_TraceLine(468,0,__PYX_ERR(0, 468, __pyx_L1_error))
6155 __pyx_v_B_data = (&(*((
double *) ( ((
char *) (((
double *) ( (__pyx_v_B_data_mv_c.data + __pyx_t_8 * __pyx_v_B_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6174 __Pyx_TraceLine(473,0,__PYX_ERR(0, 473, __pyx_L1_error))
6176 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_B, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 473, __pyx_L1_error)
6177 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
6178 __pyx_v_B_data_mv_f = __pyx_t_7;
6179 __pyx_t_7.memview = NULL;
6180 __pyx_t_7.data = NULL;
6189 __Pyx_TraceLine(476,0,__PYX_ERR(0, 476, __pyx_L1_error))
6192 __pyx_v_B_data = (&(*((
double *) ( (( ((
char *) (((
double *) __pyx_v_B_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_B_data_mv_f.strides[1]) ))));
6212 __Pyx_TraceLine(479,0,__PYX_ERR(0, 479, __pyx_L1_error))
6213 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 479, __pyx_L1_error)
6223 __Pyx_TraceLine(480,0,__PYX_ERR(0, 480, __pyx_L1_error))
6227 __Pyx_CppExn2PyErr();
6228 __PYX_ERR(0, 480, __pyx_L1_error)
6230 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_10;
6249 __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error))
6259 __Pyx_TraceLine(492,0,__PYX_ERR(0, 492, __pyx_L1_error))
6261 __pyx_t_10 =
new cDenseAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_is_row_major);
6263 __Pyx_CppExn2PyErr();
6264 __PYX_ERR(0, 486, __pyx_L1_error)
6274 __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error))
6275 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_10;
6288 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6291 __Pyx_XDECREF(__pyx_t_1);
6292 __Pyx_XDECREF(__pyx_t_2);
6293 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6294 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
6295 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6298 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_c, 1);
6299 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_f, 1);
6300 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
6301 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
6302 __Pyx_XGIVEREF(__pyx_r);
6303 __Pyx_TraceReturn(__pyx_r, 0);
6304 __Pyx_RefNannyFinishContext();
6317 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6318 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double[] =
"pycAffineMatrixFunction.set_dense_matrix_long_double(self, A, B, B_is_identity)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
6319 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double = {
"set_dense_matrix_long_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double};
6320 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6321 PyObject *__pyx_v_A = 0;
6322 PyObject *__pyx_v_B = 0;
6323 PyObject *__pyx_v_B_is_identity = 0;
6324 int __pyx_lineno = 0;
6325 const char *__pyx_filename = NULL;
6326 int __pyx_clineno = 0;
6327 PyObject *__pyx_r = 0;
6328 __Pyx_RefNannyDeclarations
6329 __Pyx_RefNannySetupContext(
"set_dense_matrix_long_double (wrapper)", 0);
6331 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
6332 PyObject* values[3] = {0,0,0};
6333 if (unlikely(__pyx_kwds)) {
6335 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6337 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6339 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6341 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6344 default:
goto __pyx_L5_argtuple_error;
6346 kw_args = PyDict_Size(__pyx_kwds);
6349 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6350 else goto __pyx_L5_argtuple_error;
6353 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
6355 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_long_double", 1, 3, 3, 1); __PYX_ERR(0, 498, __pyx_L3_error)
6359 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
6361 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_long_double", 1, 3, 3, 2); __PYX_ERR(0, 498, __pyx_L3_error)
6364 if (unlikely(kw_args > 0)) {
6365 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_dense_matrix_long_double") < 0)) __PYX_ERR(0, 498, __pyx_L3_error)
6367 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6368 goto __pyx_L5_argtuple_error;
6370 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6371 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6372 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6374 __pyx_v_A = values[0];
6375 __pyx_v_B = values[1];
6376 __pyx_v_B_is_identity = values[2];
6378 goto __pyx_L4_argument_unpacking_done;
6379 __pyx_L5_argtuple_error:;
6380 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_long_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 498, __pyx_L3_error)
6382 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6383 __Pyx_RefNannyFinishContext();
6385 __pyx_L4_argument_unpacking_done:;
6386 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
6389 __Pyx_RefNannyFinishContext();
6393 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
6394 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
6395 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
6396 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
6397 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_B_is_row_major;
6398 __Pyx_memviewslice __pyx_v_A_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
6399 __Pyx_memviewslice __pyx_v_A_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
6400 __Pyx_memviewslice __pyx_v_B_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
6401 __Pyx_memviewslice __pyx_v_B_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
6402 long double *__pyx_v_A_data;
6403 long double *__pyx_v_B_data;
6404 PyObject *__pyx_r = NULL;
6405 __Pyx_TraceDeclarations
6406 __Pyx_RefNannyDeclarations
6407 PyObject *__pyx_t_1 = NULL;
6408 PyObject *__pyx_t_2 = NULL;
6409 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
6412 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6413 __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
6414 Py_ssize_t __pyx_t_8;
6415 Py_ssize_t __pyx_t_9;
6417 int __pyx_lineno = 0;
6418 const char *__pyx_filename = NULL;
6419 int __pyx_clineno = 0;
6420 __Pyx_TraceFrameInit(__pyx_codeobj__11)
6421 __Pyx_RefNannySetupContext(
"set_dense_matrix_long_double", 0);
6422 __Pyx_TraceCall(
"set_dense_matrix_long_double", __pyx_f[0], 498, 0, __PYX_ERR(0, 498, __pyx_L1_error));
6431 __Pyx_TraceLine(507,0,__PYX_ERR(0, 507, __pyx_L1_error))
6432 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
6433 __Pyx_GOTREF(__pyx_t_1);
6434 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
6435 __Pyx_GOTREF(__pyx_t_2);
6436 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6437 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L1_error)
6438 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6439 __pyx_v_A_num_rows = __pyx_t_3;
6448 __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error))
6449 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
6450 __Pyx_GOTREF(__pyx_t_2);
6451 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
6452 __Pyx_GOTREF(__pyx_t_1);
6453 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6454 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L1_error)
6455 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6456 __pyx_v_A_num_columns = __pyx_t_3;
6465 __Pyx_TraceLine(512,0,__PYX_ERR(0, 512, __pyx_L1_error))
6466 __pyx_v_B_is_row_major = 0;
6475 __Pyx_TraceLine(514,0,__PYX_ERR(0, 514, __pyx_L1_error))
6476 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
6477 __Pyx_GOTREF(__pyx_t_1);
6478 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
6479 __Pyx_GOTREF(__pyx_t_2);
6480 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6481 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 514, __pyx_L1_error)
6482 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6492 __Pyx_TraceLine(515,0,__PYX_ERR(0, 515, __pyx_L1_error))
6493 __pyx_v_A_is_row_major = 1;
6512 __Pyx_TraceLine(516,0,__PYX_ERR(0, 516, __pyx_L1_error))
6513 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
6514 __Pyx_GOTREF(__pyx_t_2);
6515 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
6516 __Pyx_GOTREF(__pyx_t_1);
6517 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6518 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 516, __pyx_L1_error)
6519 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6520 if (likely(__pyx_t_4)) {
6529 __Pyx_TraceLine(517,0,__PYX_ERR(0, 517, __pyx_L1_error))
6530 __pyx_v_A_is_row_major = 0;
6549 __Pyx_TraceLine(519,0,__PYX_ERR(0, 519, __pyx_L1_error))
6551 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error)
6552 __Pyx_GOTREF(__pyx_t_1);
6553 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6555 __PYX_ERR(0, 519, __pyx_L1_error)
6566 __Pyx_TraceLine(521,0,__PYX_ERR(0, 521, __pyx_L1_error))
6567 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 521, __pyx_L1_error)
6568 __pyx_t_5 = ((!__pyx_t_4) != 0);
6578 __Pyx_TraceLine(522,0,__PYX_ERR(0, 522, __pyx_L1_error))
6579 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error)
6580 __Pyx_GOTREF(__pyx_t_1);
6581 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
6582 __Pyx_GOTREF(__pyx_t_2);
6583 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6584 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 522, __pyx_L1_error)
6585 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6595 __Pyx_TraceLine(523,0,__PYX_ERR(0, 523, __pyx_L1_error))
6596 __pyx_v_B_is_row_major = 1;
6615 __Pyx_TraceLine(524,0,__PYX_ERR(0, 524, __pyx_L1_error))
6616 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error)
6617 __Pyx_GOTREF(__pyx_t_2);
6618 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
6619 __Pyx_GOTREF(__pyx_t_1);
6620 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6621 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 524, __pyx_L1_error)
6622 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6623 if (likely(__pyx_t_5)) {
6632 __Pyx_TraceLine(525,0,__PYX_ERR(0, 525, __pyx_L1_error))
6633 __pyx_v_B_is_row_major = 0;
6652 __Pyx_TraceLine(527,0,__PYX_ERR(0, 527, __pyx_L1_error))
6654 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
6655 __Pyx_GOTREF(__pyx_t_1);
6656 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6657 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6658 __PYX_ERR(0, 527, __pyx_L1_error)
6678 __Pyx_TraceLine(532,0,__PYX_ERR(0, 532, __pyx_L1_error))
6679 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 532, __pyx_L1_error)
6680 __pyx_v_B_data_mv_c = __pyx_t_6;
6681 __pyx_t_6.memview = NULL;
6682 __pyx_t_6.data = NULL;
6691 __Pyx_TraceLine(533,0,__PYX_ERR(0, 533, __pyx_L1_error))
6692 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 533, __pyx_L1_error)
6693 __pyx_v_B_data_mv_f = __pyx_t_7;
6694 __pyx_t_7.memview = NULL;
6695 __pyx_t_7.data = NULL;
6704 __Pyx_TraceLine(537,0,__PYX_ERR(0, 537, __pyx_L1_error))
6705 __pyx_v_B_data = NULL;
6714 __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error))
6715 __pyx_t_5 = (__pyx_v_A_is_row_major != 0);
6725 __Pyx_TraceLine(543,0,__PYX_ERR(0, 543, __pyx_L1_error))
6726 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 543, __pyx_L1_error)
6727 __pyx_v_A_data_mv_c = __pyx_t_6;
6728 __pyx_t_6.memview = NULL;
6729 __pyx_t_6.data = NULL;
6738 __Pyx_TraceLine(546,0,__PYX_ERR(0, 546, __pyx_L1_error))
6741 __pyx_v_A_data = (&(*((
long double *) ( ((
char *) (((
long double *) ( (__pyx_v_A_data_mv_c.data + __pyx_t_8 * __pyx_v_A_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6760 __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error))
6762 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 551, __pyx_L1_error)
6763 __pyx_v_A_data_mv_f = __pyx_t_7;
6764 __pyx_t_7.memview = NULL;
6765 __pyx_t_7.data = NULL;
6774 __Pyx_TraceLine(554,0,__PYX_ERR(0, 554, __pyx_L1_error))
6777 __pyx_v_A_data = (&(*((
long double *) ( (( ((
char *) (((
long double *) __pyx_v_A_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_A_data_mv_f.strides[1]) ))));
6788 __Pyx_TraceLine(557,0,__PYX_ERR(0, 557, __pyx_L1_error))
6789 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 557, __pyx_L1_error)
6790 __pyx_t_4 = ((!__pyx_t_5) != 0);
6800 __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error))
6801 __pyx_t_4 = (__pyx_v_B_is_row_major != 0);
6811 __Pyx_TraceLine(561,0,__PYX_ERR(0, 561, __pyx_L1_error))
6812 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_B, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 561, __pyx_L1_error)
6813 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
6814 __pyx_v_B_data_mv_c = __pyx_t_6;
6815 __pyx_t_6.memview = NULL;
6816 __pyx_t_6.data = NULL;
6825 __Pyx_TraceLine(564,0,__PYX_ERR(0, 564, __pyx_L1_error))
6828 __pyx_v_B_data = (&(*((
long double *) ( ((
char *) (((
long double *) ( (__pyx_v_B_data_mv_c.data + __pyx_t_8 * __pyx_v_B_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6847 __Pyx_TraceLine(569,0,__PYX_ERR(0, 569, __pyx_L1_error))
6849 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_B, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 569, __pyx_L1_error)
6850 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
6851 __pyx_v_B_data_mv_f = __pyx_t_7;
6852 __pyx_t_7.memview = NULL;
6853 __pyx_t_7.data = NULL;
6862 __Pyx_TraceLine(572,0,__PYX_ERR(0, 572, __pyx_L1_error))
6865 __pyx_v_B_data = (&(*((
long double *) ( (( ((
char *) (((
long double *) __pyx_v_B_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_B_data_mv_f.strides[1]) ))));
6885 __Pyx_TraceLine(575,0,__PYX_ERR(0, 575, __pyx_L1_error))
6886 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 575, __pyx_L1_error)
6896 __Pyx_TraceLine(576,0,__PYX_ERR(0, 576, __pyx_L1_error))
6900 __Pyx_CppExn2PyErr();
6901 __PYX_ERR(0, 576, __pyx_L1_error)
6903 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_10;
6922 __Pyx_TraceLine(582,0,__PYX_ERR(0, 582, __pyx_L1_error))
6932 __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L1_error))
6936 __Pyx_CppExn2PyErr();
6937 __PYX_ERR(0, 582, __pyx_L1_error)
6947 __Pyx_TraceLine(582,0,__PYX_ERR(0, 582, __pyx_L1_error))
6948 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_10;
6961 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6964 __Pyx_XDECREF(__pyx_t_1);
6965 __Pyx_XDECREF(__pyx_t_2);
6966 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6967 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
6968 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6971 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_c, 1);
6972 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_f, 1);
6973 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
6974 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
6975 __Pyx_XGIVEREF(__pyx_r);
6976 __Pyx_TraceReturn(__pyx_r, 0);
6977 __Pyx_RefNannyFinishContext();
6990 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6991 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float[] =
"pycAffineMatrixFunction.set_csr_matrix_float(self, A, B, B_is_identity)\n\n ";
6992 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float = {
"set_csr_matrix_float", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float};
6993 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6994 PyObject *__pyx_v_A = 0;
6995 PyObject *__pyx_v_B = 0;
6996 PyObject *__pyx_v_B_is_identity = 0;
6997 int __pyx_lineno = 0;
6998 const char *__pyx_filename = NULL;
6999 int __pyx_clineno = 0;
7000 PyObject *__pyx_r = 0;
7001 __Pyx_RefNannyDeclarations
7002 __Pyx_RefNannySetupContext(
"set_csr_matrix_float (wrapper)", 0);
7004 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
7005 PyObject* values[3] = {0,0,0};
7006 if (unlikely(__pyx_kwds)) {
7008 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7010 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7012 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7014 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7017 default:
goto __pyx_L5_argtuple_error;
7019 kw_args = PyDict_Size(__pyx_kwds);
7022 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
7023 else goto __pyx_L5_argtuple_error;
7026 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
7028 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_float", 1, 3, 3, 1); __PYX_ERR(0, 594, __pyx_L3_error)
7032 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
7034 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_float", 1, 3, 3, 2); __PYX_ERR(0, 594, __pyx_L3_error)
7037 if (unlikely(kw_args > 0)) {
7038 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_csr_matrix_float") < 0)) __PYX_ERR(0, 594, __pyx_L3_error)
7040 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
7041 goto __pyx_L5_argtuple_error;
7043 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7044 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7045 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7047 __pyx_v_A = values[0];
7048 __pyx_v_B = values[1];
7049 __pyx_v_B_is_identity = values[2];
7051 goto __pyx_L4_argument_unpacking_done;
7052 __pyx_L5_argtuple_error:;
7053 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_float", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 594, __pyx_L3_error)
7055 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
7056 __Pyx_RefNannyFinishContext();
7058 __pyx_L4_argument_unpacking_done:;
7059 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
7062 __Pyx_RefNannyFinishContext();
7066 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
7067 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
7068 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
7069 __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7070 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7071 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7072 __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7073 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7074 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7075 float *__pyx_v_A_data;
7076 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
7077 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
7078 float *__pyx_v_B_data;
7079 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_indices;
7080 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_index_pointer;
7081 PyObject *__pyx_r = NULL;
7082 __Pyx_TraceDeclarations
7083 __Pyx_RefNannyDeclarations
7084 PyObject *__pyx_t_1 = NULL;
7085 PyObject *__pyx_t_2 = NULL;
7086 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
7087 PyObject *__pyx_t_4 = NULL;
7088 PyObject *__pyx_t_5 = NULL;
7089 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
7090 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
7093 Py_ssize_t __pyx_t_10;
7095 int __pyx_lineno = 0;
7096 const char *__pyx_filename = NULL;
7097 int __pyx_clineno = 0;
7098 __Pyx_TraceFrameInit(__pyx_codeobj__12)
7099 __Pyx_RefNannySetupContext(
"set_csr_matrix_float", 0);
7100 __Pyx_TraceCall(
"set_csr_matrix_float", __pyx_f[0], 594, 0, __PYX_ERR(0, 594, __pyx_L1_error));
7109 __Pyx_TraceLine(599,0,__PYX_ERR(0, 599, __pyx_L1_error))
7110 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error)
7111 __Pyx_GOTREF(__pyx_t_1);
7112 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error)
7113 __Pyx_GOTREF(__pyx_t_2);
7114 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7115 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error)
7116 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7117 __pyx_v_A_num_rows = __pyx_t_3;
7126 __Pyx_TraceLine(600,0,__PYX_ERR(0, 600, __pyx_L1_error))
7127 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error)
7128 __Pyx_GOTREF(__pyx_t_2);
7129 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error)
7130 __Pyx_GOTREF(__pyx_t_1);
7131 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7132 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L1_error)
7133 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7134 __pyx_v_A_num_columns = __pyx_t_3;
7143 __Pyx_TraceLine(604,0,__PYX_ERR(0, 604, __pyx_L1_error))
7144 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
7145 __Pyx_GOTREF(__pyx_t_1);
7146 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error)
7147 __Pyx_GOTREF(__pyx_t_2);
7148 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7149 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
7150 __Pyx_GOTREF(__pyx_t_1);
7151 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
7152 __Pyx_GOTREF(__pyx_t_4);
7153 __Pyx_GIVEREF(__pyx_t_1);
7154 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7156 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
7157 __Pyx_GOTREF(__pyx_t_1);
7158 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 604, __pyx_L1_error)
7159 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error)
7160 __Pyx_GOTREF(__pyx_t_5);
7161 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7162 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7163 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7172 __Pyx_TraceLine(603,0,__PYX_ERR(0, 603, __pyx_L1_error))
7173 __Pyx_GIVEREF(__pyx_t_5);
7174 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
7175 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
7176 __pyx_v_self->A_indices_copy = __pyx_t_5;
7186 __Pyx_TraceLine(606,0,__PYX_ERR(0, 606, __pyx_L1_error))
7187 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
7188 __Pyx_GOTREF(__pyx_t_5);
7189 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
7190 __Pyx_GOTREF(__pyx_t_1);
7191 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7192 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
7193 __Pyx_GOTREF(__pyx_t_5);
7194 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
7195 __Pyx_GOTREF(__pyx_t_4);
7196 __Pyx_GIVEREF(__pyx_t_5);
7197 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
7199 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
7200 __Pyx_GOTREF(__pyx_t_5);
7201 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
7202 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
7203 __Pyx_GOTREF(__pyx_t_2);
7204 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7205 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7206 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7215 __Pyx_TraceLine(605,0,__PYX_ERR(0, 605, __pyx_L1_error))
7216 __Pyx_GIVEREF(__pyx_t_2);
7217 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
7218 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
7219 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
7229 __Pyx_TraceLine(609,0,__PYX_ERR(0, 609, __pyx_L1_error))
7230 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error)
7231 __Pyx_GOTREF(__pyx_t_2);
7232 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 609, __pyx_L1_error)
7233 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7234 __pyx_v_A_data_mv = __pyx_t_6;
7235 __pyx_t_6.memview = NULL;
7236 __pyx_t_6.data = NULL;
7245 __Pyx_TraceLine(610,0,__PYX_ERR(0, 610, __pyx_L1_error))
7246 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 610, __pyx_L1_error)
7247 __pyx_v_A_indices_mv = __pyx_t_7;
7248 __pyx_t_7.memview = NULL;
7249 __pyx_t_7.data = NULL;
7258 __Pyx_TraceLine(612,0,__PYX_ERR(0, 612, __pyx_L1_error))
7259 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 612, __pyx_L1_error)
7260 __pyx_v_A_index_pointer_mv = __pyx_t_7;
7261 __pyx_t_7.memview = NULL;
7262 __pyx_t_7.data = NULL;
7271 __Pyx_TraceLine(613,0,__PYX_ERR(0, 613, __pyx_L1_error))
7272 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 613, __pyx_L1_error)
7273 __pyx_v_B_data_mv = __pyx_t_6;
7274 __pyx_t_6.memview = NULL;
7275 __pyx_t_6.data = NULL;
7284 __Pyx_TraceLine(614,0,__PYX_ERR(0, 614, __pyx_L1_error))
7285 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 614, __pyx_L1_error)
7286 __pyx_v_B_indices_mv = __pyx_t_7;
7287 __pyx_t_7.memview = NULL;
7288 __pyx_t_7.data = NULL;
7297 __Pyx_TraceLine(615,0,__PYX_ERR(0, 615, __pyx_L1_error))
7298 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 615, __pyx_L1_error)
7299 __pyx_v_B_index_pointer_mv = __pyx_t_7;
7300 __pyx_t_7.memview = NULL;
7301 __pyx_t_7.data = NULL;
7310 __Pyx_TraceLine(617,0,__PYX_ERR(0, 617, __pyx_L1_error))
7311 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 617, __pyx_L1_error)
7312 __pyx_t_9 = ((!__pyx_t_8) != 0);
7322 __Pyx_TraceLine(621,0,__PYX_ERR(0, 621, __pyx_L1_error))
7323 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error)
7324 __Pyx_GOTREF(__pyx_t_2);
7325 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 621, __pyx_L1_error)
7326 __Pyx_GOTREF(__pyx_t_5);
7327 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7328 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error)
7329 __Pyx_GOTREF(__pyx_t_2);
7330 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error)
7331 __Pyx_GOTREF(__pyx_t_4);
7332 __Pyx_GIVEREF(__pyx_t_2);
7333 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
7335 __pyx_t_2 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error)
7336 __Pyx_GOTREF(__pyx_t_2);
7337 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 621, __pyx_L1_error)
7338 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error)
7339 __Pyx_GOTREF(__pyx_t_1);
7340 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7341 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7342 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7351 __Pyx_TraceLine(620,0,__PYX_ERR(0, 620, __pyx_L1_error))
7352 __Pyx_GIVEREF(__pyx_t_1);
7353 __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
7354 __Pyx_DECREF(__pyx_v_self->B_indices_copy);
7355 __pyx_v_self->B_indices_copy = __pyx_t_1;
7365 __Pyx_TraceLine(623,0,__PYX_ERR(0, 623, __pyx_L1_error))
7366 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
7367 __Pyx_GOTREF(__pyx_t_1);
7368 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error)
7369 __Pyx_GOTREF(__pyx_t_2);
7370 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7371 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
7372 __Pyx_GOTREF(__pyx_t_1);
7373 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
7374 __Pyx_GOTREF(__pyx_t_4);
7375 __Pyx_GIVEREF(__pyx_t_1);
7376 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7378 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
7379 __Pyx_GOTREF(__pyx_t_1);
7380 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 623, __pyx_L1_error)
7381 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error)
7382 __Pyx_GOTREF(__pyx_t_5);
7383 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7384 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7385 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7394 __Pyx_TraceLine(622,0,__PYX_ERR(0, 622, __pyx_L1_error))
7395 __Pyx_GIVEREF(__pyx_t_5);
7396 __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
7397 __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
7398 __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
7408 __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error))
7409 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L1_error)
7410 __Pyx_GOTREF(__pyx_t_5);
7411 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 625, __pyx_L1_error)
7412 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7413 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
7414 __pyx_v_B_data_mv = __pyx_t_6;
7415 __pyx_t_6.memview = NULL;
7416 __pyx_t_6.data = NULL;
7425 __Pyx_TraceLine(626,0,__PYX_ERR(0, 626, __pyx_L1_error))
7426 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 626, __pyx_L1_error)
7427 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
7428 __pyx_v_B_indices_mv = __pyx_t_7;
7429 __pyx_t_7.memview = NULL;
7430 __pyx_t_7.data = NULL;
7439 __Pyx_TraceLine(627,0,__PYX_ERR(0, 627, __pyx_L1_error))
7440 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 627, __pyx_L1_error)
7441 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
7442 __pyx_v_B_index_pointer_mv = __pyx_t_7;
7443 __pyx_t_7.memview = NULL;
7444 __pyx_t_7.data = NULL;
7462 __Pyx_TraceLine(630,0,__PYX_ERR(0, 630, __pyx_L1_error))
7464 __pyx_v_A_data = (&(*((
float *) ( (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
7473 __Pyx_TraceLine(631,0,__PYX_ERR(0, 631, __pyx_L1_error))
7475 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
7484 __Pyx_TraceLine(632,0,__PYX_ERR(0, 632, __pyx_L1_error))
7486 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
7495 __Pyx_TraceLine(633,0,__PYX_ERR(0, 633, __pyx_L1_error))
7496 __pyx_v_B_data = NULL;
7505 __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error))
7506 __pyx_v_B_indices = NULL;
7515 __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error))
7516 __pyx_v_B_index_pointer = NULL;
7525 __Pyx_TraceLine(637,0,__PYX_ERR(0, 637, __pyx_L1_error))
7526 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 637, __pyx_L1_error)
7527 __pyx_t_8 = ((!__pyx_t_9) != 0);
7537 __Pyx_TraceLine(638,0,__PYX_ERR(0, 638, __pyx_L1_error))
7539 __pyx_v_B_data = (&(*((
float *) ( (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
7548 __Pyx_TraceLine(639,0,__PYX_ERR(0, 639, __pyx_L1_error))
7550 __pyx_v_B_indices = (&(*((
int *) ( (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
7559 __Pyx_TraceLine(640,0,__PYX_ERR(0, 640, __pyx_L1_error))
7561 __pyx_v_B_index_pointer = (&(*((
int *) ( (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
7579 __Pyx_TraceLine(643,0,__PYX_ERR(0, 643, __pyx_L1_error))
7580 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
7590 __Pyx_TraceLine(644,0,__PYX_ERR(0, 644, __pyx_L1_error))
7592 __pyx_t_11 =
new cCSRAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
7594 __Pyx_CppExn2PyErr();
7595 __PYX_ERR(0, 644, __pyx_L1_error)
7597 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
7616 __Pyx_TraceLine(651,0,__PYX_ERR(0, 651, __pyx_L1_error))
7626 __Pyx_TraceLine(659,0,__PYX_ERR(0, 659, __pyx_L1_error))
7628 __pyx_t_11 =
new cCSRAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
7630 __Pyx_CppExn2PyErr();
7631 __PYX_ERR(0, 651, __pyx_L1_error)
7641 __Pyx_TraceLine(651,0,__PYX_ERR(0, 651, __pyx_L1_error))
7642 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
7655 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7658 __Pyx_XDECREF(__pyx_t_1);
7659 __Pyx_XDECREF(__pyx_t_2);
7660 __Pyx_XDECREF(__pyx_t_4);
7661 __Pyx_XDECREF(__pyx_t_5);
7662 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
7663 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
7664 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
7667 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
7668 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
7669 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
7670 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
7671 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
7672 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
7673 __Pyx_XGIVEREF(__pyx_r);
7674 __Pyx_TraceReturn(__pyx_r, 0);
7675 __Pyx_RefNannyFinishContext();
7688 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7689 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double[] =
"pycAffineMatrixFunction.set_csr_matrix_double(self, A, B, B_is_identity)\n\n ";
7690 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double = {
"set_csr_matrix_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double};
7691 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7692 PyObject *__pyx_v_A = 0;
7693 PyObject *__pyx_v_B = 0;
7694 PyObject *__pyx_v_B_is_identity = 0;
7695 int __pyx_lineno = 0;
7696 const char *__pyx_filename = NULL;
7697 int __pyx_clineno = 0;
7698 PyObject *__pyx_r = 0;
7699 __Pyx_RefNannyDeclarations
7700 __Pyx_RefNannySetupContext(
"set_csr_matrix_double (wrapper)", 0);
7702 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
7703 PyObject* values[3] = {0,0,0};
7704 if (unlikely(__pyx_kwds)) {
7706 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7708 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7710 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7712 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7715 default:
goto __pyx_L5_argtuple_error;
7717 kw_args = PyDict_Size(__pyx_kwds);
7720 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
7721 else goto __pyx_L5_argtuple_error;
7724 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
7726 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_double", 1, 3, 3, 1); __PYX_ERR(0, 665, __pyx_L3_error)
7730 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
7732 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_double", 1, 3, 3, 2); __PYX_ERR(0, 665, __pyx_L3_error)
7735 if (unlikely(kw_args > 0)) {
7736 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_csr_matrix_double") < 0)) __PYX_ERR(0, 665, __pyx_L3_error)
7738 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
7739 goto __pyx_L5_argtuple_error;
7741 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7742 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7743 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7745 __pyx_v_A = values[0];
7746 __pyx_v_B = values[1];
7747 __pyx_v_B_is_identity = values[2];
7749 goto __pyx_L4_argument_unpacking_done;
7750 __pyx_L5_argtuple_error:;
7751 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 665, __pyx_L3_error)
7753 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
7754 __Pyx_RefNannyFinishContext();
7756 __pyx_L4_argument_unpacking_done:;
7757 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
7760 __Pyx_RefNannyFinishContext();
7764 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
7765 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
7766 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
7767 __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7768 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7769 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7770 __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7771 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7772 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7773 double *__pyx_v_A_data;
7774 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
7775 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
7776 double *__pyx_v_B_data;
7777 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_indices;
7778 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_index_pointer;
7779 PyObject *__pyx_r = NULL;
7780 __Pyx_TraceDeclarations
7781 __Pyx_RefNannyDeclarations
7782 PyObject *__pyx_t_1 = NULL;
7783 PyObject *__pyx_t_2 = NULL;
7784 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
7785 PyObject *__pyx_t_4 = NULL;
7786 PyObject *__pyx_t_5 = NULL;
7787 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
7788 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
7791 Py_ssize_t __pyx_t_10;
7793 int __pyx_lineno = 0;
7794 const char *__pyx_filename = NULL;
7795 int __pyx_clineno = 0;
7796 __Pyx_TraceFrameInit(__pyx_codeobj__13)
7797 __Pyx_RefNannySetupContext(
"set_csr_matrix_double", 0);
7798 __Pyx_TraceCall(
"set_csr_matrix_double", __pyx_f[0], 665, 0, __PYX_ERR(0, 665, __pyx_L1_error));
7807 __Pyx_TraceLine(670,0,__PYX_ERR(0, 670, __pyx_L1_error))
7808 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
7809 __Pyx_GOTREF(__pyx_t_1);
7810 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error)
7811 __Pyx_GOTREF(__pyx_t_2);
7812 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7813 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L1_error)
7814 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7815 __pyx_v_A_num_rows = __pyx_t_3;
7824 __Pyx_TraceLine(671,0,__PYX_ERR(0, 671, __pyx_L1_error))
7825 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error)
7826 __Pyx_GOTREF(__pyx_t_2);
7827 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
7828 __Pyx_GOTREF(__pyx_t_1);
7829 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7830 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 671, __pyx_L1_error)
7831 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7832 __pyx_v_A_num_columns = __pyx_t_3;
7841 __Pyx_TraceLine(675,0,__PYX_ERR(0, 675, __pyx_L1_error))
7842 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
7843 __Pyx_GOTREF(__pyx_t_1);
7844 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error)
7845 __Pyx_GOTREF(__pyx_t_2);
7846 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7847 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
7848 __Pyx_GOTREF(__pyx_t_1);
7849 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error)
7850 __Pyx_GOTREF(__pyx_t_4);
7851 __Pyx_GIVEREF(__pyx_t_1);
7852 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7854 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
7855 __Pyx_GOTREF(__pyx_t_1);
7856 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 675, __pyx_L1_error)
7857 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error)
7858 __Pyx_GOTREF(__pyx_t_5);
7859 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7860 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7861 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7870 __Pyx_TraceLine(674,0,__PYX_ERR(0, 674, __pyx_L1_error))
7871 __Pyx_GIVEREF(__pyx_t_5);
7872 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
7873 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
7874 __pyx_v_self->A_indices_copy = __pyx_t_5;
7884 __Pyx_TraceLine(677,0,__PYX_ERR(0, 677, __pyx_L1_error))
7885 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
7886 __Pyx_GOTREF(__pyx_t_5);
7887 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error)
7888 __Pyx_GOTREF(__pyx_t_1);
7889 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7890 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
7891 __Pyx_GOTREF(__pyx_t_5);
7892 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
7893 __Pyx_GOTREF(__pyx_t_4);
7894 __Pyx_GIVEREF(__pyx_t_5);
7895 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
7897 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
7898 __Pyx_GOTREF(__pyx_t_5);
7899 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 677, __pyx_L1_error)
7900 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error)
7901 __Pyx_GOTREF(__pyx_t_2);
7902 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7903 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7904 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7913 __Pyx_TraceLine(676,0,__PYX_ERR(0, 676, __pyx_L1_error))
7914 __Pyx_GIVEREF(__pyx_t_2);
7915 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
7916 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
7917 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
7927 __Pyx_TraceLine(680,0,__PYX_ERR(0, 680, __pyx_L1_error))
7928 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
7929 __Pyx_GOTREF(__pyx_t_2);
7930 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 680, __pyx_L1_error)
7931 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7932 __pyx_v_A_data_mv = __pyx_t_6;
7933 __pyx_t_6.memview = NULL;
7934 __pyx_t_6.data = NULL;
7943 __Pyx_TraceLine(681,0,__PYX_ERR(0, 681, __pyx_L1_error))
7944 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 681, __pyx_L1_error)
7945 __pyx_v_A_indices_mv = __pyx_t_7;
7946 __pyx_t_7.memview = NULL;
7947 __pyx_t_7.data = NULL;
7956 __Pyx_TraceLine(683,0,__PYX_ERR(0, 683, __pyx_L1_error))
7957 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 683, __pyx_L1_error)
7958 __pyx_v_A_index_pointer_mv = __pyx_t_7;
7959 __pyx_t_7.memview = NULL;
7960 __pyx_t_7.data = NULL;
7969 __Pyx_TraceLine(684,0,__PYX_ERR(0, 684, __pyx_L1_error))
7970 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 684, __pyx_L1_error)
7971 __pyx_v_B_data_mv = __pyx_t_6;
7972 __pyx_t_6.memview = NULL;
7973 __pyx_t_6.data = NULL;
7982 __Pyx_TraceLine(685,0,__PYX_ERR(0, 685, __pyx_L1_error))
7983 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 685, __pyx_L1_error)
7984 __pyx_v_B_indices_mv = __pyx_t_7;
7985 __pyx_t_7.memview = NULL;
7986 __pyx_t_7.data = NULL;
7995 __Pyx_TraceLine(686,0,__PYX_ERR(0, 686, __pyx_L1_error))
7996 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 686, __pyx_L1_error)
7997 __pyx_v_B_index_pointer_mv = __pyx_t_7;
7998 __pyx_t_7.memview = NULL;
7999 __pyx_t_7.data = NULL;
8008 __Pyx_TraceLine(688,0,__PYX_ERR(0, 688, __pyx_L1_error))
8009 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 688, __pyx_L1_error)
8010 __pyx_t_9 = ((!__pyx_t_8) != 0);
8020 __Pyx_TraceLine(692,0,__PYX_ERR(0, 692, __pyx_L1_error))
8021 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
8022 __Pyx_GOTREF(__pyx_t_2);
8023 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error)
8024 __Pyx_GOTREF(__pyx_t_5);
8025 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8026 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
8027 __Pyx_GOTREF(__pyx_t_2);
8028 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
8029 __Pyx_GOTREF(__pyx_t_4);
8030 __Pyx_GIVEREF(__pyx_t_2);
8031 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
8033 __pyx_t_2 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
8034 __Pyx_GOTREF(__pyx_t_2);
8035 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
8036 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
8037 __Pyx_GOTREF(__pyx_t_1);
8038 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8039 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8040 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8049 __Pyx_TraceLine(691,0,__PYX_ERR(0, 691, __pyx_L1_error))
8050 __Pyx_GIVEREF(__pyx_t_1);
8051 __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
8052 __Pyx_DECREF(__pyx_v_self->B_indices_copy);
8053 __pyx_v_self->B_indices_copy = __pyx_t_1;
8063 __Pyx_TraceLine(694,0,__PYX_ERR(0, 694, __pyx_L1_error))
8064 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
8065 __Pyx_GOTREF(__pyx_t_1);
8066 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
8067 __Pyx_GOTREF(__pyx_t_2);
8068 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8069 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
8070 __Pyx_GOTREF(__pyx_t_1);
8071 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
8072 __Pyx_GOTREF(__pyx_t_4);
8073 __Pyx_GIVEREF(__pyx_t_1);
8074 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8076 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
8077 __Pyx_GOTREF(__pyx_t_1);
8078 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 694, __pyx_L1_error)
8079 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
8080 __Pyx_GOTREF(__pyx_t_5);
8081 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8082 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8083 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8092 __Pyx_TraceLine(693,0,__PYX_ERR(0, 693, __pyx_L1_error))
8093 __Pyx_GIVEREF(__pyx_t_5);
8094 __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
8095 __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
8096 __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
8106 __Pyx_TraceLine(696,0,__PYX_ERR(0, 696, __pyx_L1_error))
8107 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error)
8108 __Pyx_GOTREF(__pyx_t_5);
8109 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_5, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 696, __pyx_L1_error)
8110 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8111 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
8112 __pyx_v_B_data_mv = __pyx_t_6;
8113 __pyx_t_6.memview = NULL;
8114 __pyx_t_6.data = NULL;
8123 __Pyx_TraceLine(697,0,__PYX_ERR(0, 697, __pyx_L1_error))
8124 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 697, __pyx_L1_error)
8125 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
8126 __pyx_v_B_indices_mv = __pyx_t_7;
8127 __pyx_t_7.memview = NULL;
8128 __pyx_t_7.data = NULL;
8137 __Pyx_TraceLine(698,0,__PYX_ERR(0, 698, __pyx_L1_error))
8138 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 698, __pyx_L1_error)
8139 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
8140 __pyx_v_B_index_pointer_mv = __pyx_t_7;
8141 __pyx_t_7.memview = NULL;
8142 __pyx_t_7.data = NULL;
8160 __Pyx_TraceLine(701,0,__PYX_ERR(0, 701, __pyx_L1_error))
8162 __pyx_v_A_data = (&(*((
double *) ( (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
8171 __Pyx_TraceLine(702,0,__PYX_ERR(0, 702, __pyx_L1_error))
8173 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
8182 __Pyx_TraceLine(703,0,__PYX_ERR(0, 703, __pyx_L1_error))
8184 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
8193 __Pyx_TraceLine(704,0,__PYX_ERR(0, 704, __pyx_L1_error))
8194 __pyx_v_B_data = NULL;
8203 __Pyx_TraceLine(705,0,__PYX_ERR(0, 705, __pyx_L1_error))
8204 __pyx_v_B_indices = NULL;
8213 __Pyx_TraceLine(706,0,__PYX_ERR(0, 706, __pyx_L1_error))
8214 __pyx_v_B_index_pointer = NULL;
8223 __Pyx_TraceLine(708,0,__PYX_ERR(0, 708, __pyx_L1_error))
8224 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 708, __pyx_L1_error)
8225 __pyx_t_8 = ((!__pyx_t_9) != 0);
8235 __Pyx_TraceLine(709,0,__PYX_ERR(0, 709, __pyx_L1_error))
8237 __pyx_v_B_data = (&(*((
double *) ( (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
8246 __Pyx_TraceLine(710,0,__PYX_ERR(0, 710, __pyx_L1_error))
8248 __pyx_v_B_indices = (&(*((
int *) ( (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
8257 __Pyx_TraceLine(711,0,__PYX_ERR(0, 711, __pyx_L1_error))
8259 __pyx_v_B_index_pointer = (&(*((
int *) ( (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
8277 __Pyx_TraceLine(714,0,__PYX_ERR(0, 714, __pyx_L1_error))
8278 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 714, __pyx_L1_error)
8288 __Pyx_TraceLine(715,0,__PYX_ERR(0, 715, __pyx_L1_error))
8292 __Pyx_CppExn2PyErr();
8293 __PYX_ERR(0, 715, __pyx_L1_error)
8295 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
8314 __Pyx_TraceLine(722,0,__PYX_ERR(0, 722, __pyx_L1_error))
8324 __Pyx_TraceLine(730,0,__PYX_ERR(0, 730, __pyx_L1_error))
8326 __pyx_t_11 =
new cCSRAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
8328 __Pyx_CppExn2PyErr();
8329 __PYX_ERR(0, 722, __pyx_L1_error)
8339 __Pyx_TraceLine(722,0,__PYX_ERR(0, 722, __pyx_L1_error))
8340 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
8353 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8356 __Pyx_XDECREF(__pyx_t_1);
8357 __Pyx_XDECREF(__pyx_t_2);
8358 __Pyx_XDECREF(__pyx_t_4);
8359 __Pyx_XDECREF(__pyx_t_5);
8360 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
8361 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
8362 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
8365 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
8366 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
8367 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
8368 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
8369 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
8370 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
8371 __Pyx_XGIVEREF(__pyx_r);
8372 __Pyx_TraceReturn(__pyx_r, 0);
8373 __Pyx_RefNannyFinishContext();
8386 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8387 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double[] =
"pycAffineMatrixFunction.set_csr_matrix_long_double(self, A, B, B_is_identity)\n\n ";
8388 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double = {
"set_csr_matrix_long_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double};
8389 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8390 PyObject *__pyx_v_A = 0;
8391 PyObject *__pyx_v_B = 0;
8392 PyObject *__pyx_v_B_is_identity = 0;
8393 int __pyx_lineno = 0;
8394 const char *__pyx_filename = NULL;
8395 int __pyx_clineno = 0;
8396 PyObject *__pyx_r = 0;
8397 __Pyx_RefNannyDeclarations
8398 __Pyx_RefNannySetupContext(
"set_csr_matrix_long_double (wrapper)", 0);
8400 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
8401 PyObject* values[3] = {0,0,0};
8402 if (unlikely(__pyx_kwds)) {
8404 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8406 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8408 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8410 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8413 default:
goto __pyx_L5_argtuple_error;
8415 kw_args = PyDict_Size(__pyx_kwds);
8418 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
8419 else goto __pyx_L5_argtuple_error;
8422 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
8424 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_long_double", 1, 3, 3, 1); __PYX_ERR(0, 736, __pyx_L3_error)
8428 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
8430 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_long_double", 1, 3, 3, 2); __PYX_ERR(0, 736, __pyx_L3_error)
8433 if (unlikely(kw_args > 0)) {
8434 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_csr_matrix_long_double") < 0)) __PYX_ERR(0, 736, __pyx_L3_error)
8436 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
8437 goto __pyx_L5_argtuple_error;
8439 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8440 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8441 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8443 __pyx_v_A = values[0];
8444 __pyx_v_B = values[1];
8445 __pyx_v_B_is_identity = values[2];
8447 goto __pyx_L4_argument_unpacking_done;
8448 __pyx_L5_argtuple_error:;
8449 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_long_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 736, __pyx_L3_error)
8451 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
8452 __Pyx_RefNannyFinishContext();
8454 __pyx_L4_argument_unpacking_done:;
8455 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
8458 __Pyx_RefNannyFinishContext();
8462 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
8463 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
8464 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
8465 __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8466 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8467 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8468 __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8469 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8470 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8471 long double *__pyx_v_A_data;
8472 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
8473 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
8474 long double *__pyx_v_B_data;
8475 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_indices;
8476 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_index_pointer;
8477 PyObject *__pyx_r = NULL;
8478 __Pyx_TraceDeclarations
8479 __Pyx_RefNannyDeclarations
8480 PyObject *__pyx_t_1 = NULL;
8481 PyObject *__pyx_t_2 = NULL;
8482 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
8483 PyObject *__pyx_t_4 = NULL;
8484 PyObject *__pyx_t_5 = NULL;
8485 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
8486 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
8489 Py_ssize_t __pyx_t_10;
8491 int __pyx_lineno = 0;
8492 const char *__pyx_filename = NULL;
8493 int __pyx_clineno = 0;
8494 __Pyx_TraceFrameInit(__pyx_codeobj__14)
8495 __Pyx_RefNannySetupContext(
"set_csr_matrix_long_double", 0);
8496 __Pyx_TraceCall(
"set_csr_matrix_long_double", __pyx_f[0], 736, 0, __PYX_ERR(0, 736, __pyx_L1_error));
8505 __Pyx_TraceLine(741,0,__PYX_ERR(0, 741, __pyx_L1_error))
8506 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
8507 __Pyx_GOTREF(__pyx_t_1);
8508 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error)
8509 __Pyx_GOTREF(__pyx_t_2);
8510 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8511 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 741, __pyx_L1_error)
8512 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8513 __pyx_v_A_num_rows = __pyx_t_3;
8522 __Pyx_TraceLine(742,0,__PYX_ERR(0, 742, __pyx_L1_error))
8523 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
8524 __Pyx_GOTREF(__pyx_t_2);
8525 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
8526 __Pyx_GOTREF(__pyx_t_1);
8527 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8528 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 742, __pyx_L1_error)
8529 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8530 __pyx_v_A_num_columns = __pyx_t_3;
8539 __Pyx_TraceLine(746,0,__PYX_ERR(0, 746, __pyx_L1_error))
8540 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
8541 __Pyx_GOTREF(__pyx_t_1);
8542 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
8543 __Pyx_GOTREF(__pyx_t_2);
8544 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8545 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
8546 __Pyx_GOTREF(__pyx_t_1);
8547 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error)
8548 __Pyx_GOTREF(__pyx_t_4);
8549 __Pyx_GIVEREF(__pyx_t_1);
8550 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8552 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
8553 __Pyx_GOTREF(__pyx_t_1);
8554 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
8555 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error)
8556 __Pyx_GOTREF(__pyx_t_5);
8557 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8558 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8559 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8568 __Pyx_TraceLine(745,0,__PYX_ERR(0, 745, __pyx_L1_error))
8569 __Pyx_GIVEREF(__pyx_t_5);
8570 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
8571 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
8572 __pyx_v_self->A_indices_copy = __pyx_t_5;
8582 __Pyx_TraceLine(748,0,__PYX_ERR(0, 748, __pyx_L1_error))
8583 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
8584 __Pyx_GOTREF(__pyx_t_5);
8585 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
8586 __Pyx_GOTREF(__pyx_t_1);
8587 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8588 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
8589 __Pyx_GOTREF(__pyx_t_5);
8590 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 748, __pyx_L1_error)
8591 __Pyx_GOTREF(__pyx_t_4);
8592 __Pyx_GIVEREF(__pyx_t_5);
8593 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
8595 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
8596 __Pyx_GOTREF(__pyx_t_5);
8597 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 748, __pyx_L1_error)
8598 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
8599 __Pyx_GOTREF(__pyx_t_2);
8600 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8601 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8602 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8611 __Pyx_TraceLine(747,0,__PYX_ERR(0, 747, __pyx_L1_error))
8612 __Pyx_GIVEREF(__pyx_t_2);
8613 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
8614 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
8615 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
8625 __Pyx_TraceLine(751,0,__PYX_ERR(0, 751, __pyx_L1_error))
8626 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error)
8627 __Pyx_GOTREF(__pyx_t_2);
8628 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 751, __pyx_L1_error)
8629 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8630 __pyx_v_A_data_mv = __pyx_t_6;
8631 __pyx_t_6.memview = NULL;
8632 __pyx_t_6.data = NULL;
8641 __Pyx_TraceLine(752,0,__PYX_ERR(0, 752, __pyx_L1_error))
8642 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 752, __pyx_L1_error)
8643 __pyx_v_A_indices_mv = __pyx_t_7;
8644 __pyx_t_7.memview = NULL;
8645 __pyx_t_7.data = NULL;
8654 __Pyx_TraceLine(754,0,__PYX_ERR(0, 754, __pyx_L1_error))
8655 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 754, __pyx_L1_error)
8656 __pyx_v_A_index_pointer_mv = __pyx_t_7;
8657 __pyx_t_7.memview = NULL;
8658 __pyx_t_7.data = NULL;
8667 __Pyx_TraceLine(755,0,__PYX_ERR(0, 755, __pyx_L1_error))
8668 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 755, __pyx_L1_error)
8669 __pyx_v_B_data_mv = __pyx_t_6;
8670 __pyx_t_6.memview = NULL;
8671 __pyx_t_6.data = NULL;
8680 __Pyx_TraceLine(756,0,__PYX_ERR(0, 756, __pyx_L1_error))
8681 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 756, __pyx_L1_error)
8682 __pyx_v_B_indices_mv = __pyx_t_7;
8683 __pyx_t_7.memview = NULL;
8684 __pyx_t_7.data = NULL;
8693 __Pyx_TraceLine(757,0,__PYX_ERR(0, 757, __pyx_L1_error))
8694 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 757, __pyx_L1_error)
8695 __pyx_v_B_index_pointer_mv = __pyx_t_7;
8696 __pyx_t_7.memview = NULL;
8697 __pyx_t_7.data = NULL;
8706 __Pyx_TraceLine(759,0,__PYX_ERR(0, 759, __pyx_L1_error))
8707 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 759, __pyx_L1_error)
8708 __pyx_t_9 = ((!__pyx_t_8) != 0);
8718 __Pyx_TraceLine(763,0,__PYX_ERR(0, 763, __pyx_L1_error))
8719 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
8720 __Pyx_GOTREF(__pyx_t_2);
8721 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error)
8722 __Pyx_GOTREF(__pyx_t_5);
8723 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8724 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
8725 __Pyx_GOTREF(__pyx_t_2);
8726 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
8727 __Pyx_GOTREF(__pyx_t_4);
8728 __Pyx_GIVEREF(__pyx_t_2);
8729 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
8731 __pyx_t_2 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
8732 __Pyx_GOTREF(__pyx_t_2);
8733 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 763, __pyx_L1_error)
8734 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error)
8735 __Pyx_GOTREF(__pyx_t_1);
8736 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8737 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8738 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8747 __Pyx_TraceLine(762,0,__PYX_ERR(0, 762, __pyx_L1_error))
8748 __Pyx_GIVEREF(__pyx_t_1);
8749 __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
8750 __Pyx_DECREF(__pyx_v_self->B_indices_copy);
8751 __pyx_v_self->B_indices_copy = __pyx_t_1;
8761 __Pyx_TraceLine(765,0,__PYX_ERR(0, 765, __pyx_L1_error))
8762 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
8763 __Pyx_GOTREF(__pyx_t_1);
8764 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
8765 __Pyx_GOTREF(__pyx_t_2);
8766 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8767 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
8768 __Pyx_GOTREF(__pyx_t_1);
8769 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
8770 __Pyx_GOTREF(__pyx_t_4);
8771 __Pyx_GIVEREF(__pyx_t_1);
8772 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8774 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
8775 __Pyx_GOTREF(__pyx_t_1);
8776 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 765, __pyx_L1_error)
8777 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 765, __pyx_L1_error)
8778 __Pyx_GOTREF(__pyx_t_5);
8779 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8780 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8781 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8790 __Pyx_TraceLine(764,0,__PYX_ERR(0, 764, __pyx_L1_error))
8791 __Pyx_GIVEREF(__pyx_t_5);
8792 __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
8793 __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
8794 __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
8804 __Pyx_TraceLine(767,0,__PYX_ERR(0, 767, __pyx_L1_error))
8805 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error)
8806 __Pyx_GOTREF(__pyx_t_5);
8807 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_5, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 767, __pyx_L1_error)
8808 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8809 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
8810 __pyx_v_B_data_mv = __pyx_t_6;
8811 __pyx_t_6.memview = NULL;
8812 __pyx_t_6.data = NULL;
8821 __Pyx_TraceLine(768,0,__PYX_ERR(0, 768, __pyx_L1_error))
8822 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 768, __pyx_L1_error)
8823 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
8824 __pyx_v_B_indices_mv = __pyx_t_7;
8825 __pyx_t_7.memview = NULL;
8826 __pyx_t_7.data = NULL;
8835 __Pyx_TraceLine(769,0,__PYX_ERR(0, 769, __pyx_L1_error))
8836 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 769, __pyx_L1_error)
8837 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
8838 __pyx_v_B_index_pointer_mv = __pyx_t_7;
8839 __pyx_t_7.memview = NULL;
8840 __pyx_t_7.data = NULL;
8858 __Pyx_TraceLine(772,0,__PYX_ERR(0, 772, __pyx_L1_error))
8860 __pyx_v_A_data = (&(*((
long double *) ( (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
8869 __Pyx_TraceLine(773,0,__PYX_ERR(0, 773, __pyx_L1_error))
8871 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
8880 __Pyx_TraceLine(774,0,__PYX_ERR(0, 774, __pyx_L1_error))
8882 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
8891 __Pyx_TraceLine(775,0,__PYX_ERR(0, 775, __pyx_L1_error))
8892 __pyx_v_B_data = NULL;
8901 __Pyx_TraceLine(776,0,__PYX_ERR(0, 776, __pyx_L1_error))
8902 __pyx_v_B_indices = NULL;
8911 __Pyx_TraceLine(777,0,__PYX_ERR(0, 777, __pyx_L1_error))
8912 __pyx_v_B_index_pointer = NULL;
8921 __Pyx_TraceLine(779,0,__PYX_ERR(0, 779, __pyx_L1_error))
8922 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 779, __pyx_L1_error)
8923 __pyx_t_8 = ((!__pyx_t_9) != 0);
8933 __Pyx_TraceLine(780,0,__PYX_ERR(0, 780, __pyx_L1_error))
8935 __pyx_v_B_data = (&(*((
long double *) ( (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
8944 __Pyx_TraceLine(781,0,__PYX_ERR(0, 781, __pyx_L1_error))
8946 __pyx_v_B_indices = (&(*((
int *) ( (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
8955 __Pyx_TraceLine(782,0,__PYX_ERR(0, 782, __pyx_L1_error))
8957 __pyx_v_B_index_pointer = (&(*((
int *) ( (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
8975 __Pyx_TraceLine(785,0,__PYX_ERR(0, 785, __pyx_L1_error))
8976 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 785, __pyx_L1_error)
8986 __Pyx_TraceLine(786,0,__PYX_ERR(0, 786, __pyx_L1_error))
8990 __Pyx_CppExn2PyErr();
8991 __PYX_ERR(0, 786, __pyx_L1_error)
8993 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
9012 __Pyx_TraceLine(793,0,__PYX_ERR(0, 793, __pyx_L1_error))
9022 __Pyx_TraceLine(801,0,__PYX_ERR(0, 801, __pyx_L1_error))
9024 __pyx_t_11 =
new cCSRAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
9026 __Pyx_CppExn2PyErr();
9027 __PYX_ERR(0, 793, __pyx_L1_error)
9037 __Pyx_TraceLine(793,0,__PYX_ERR(0, 793, __pyx_L1_error))
9038 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
9051 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9054 __Pyx_XDECREF(__pyx_t_1);
9055 __Pyx_XDECREF(__pyx_t_2);
9056 __Pyx_XDECREF(__pyx_t_4);
9057 __Pyx_XDECREF(__pyx_t_5);
9058 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
9059 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
9060 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
9063 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
9064 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
9065 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
9066 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9067 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9068 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9069 __Pyx_XGIVEREF(__pyx_r);
9070 __Pyx_TraceReturn(__pyx_r, 0);
9071 __Pyx_RefNannyFinishContext();
9084 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9085 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float[] =
"pycAffineMatrixFunction.set_csc_matrix_float(self, A, B, B_is_identity)\n\n ";
9086 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float = {
"set_csc_matrix_float", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float};
9087 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9088 PyObject *__pyx_v_A = 0;
9089 PyObject *__pyx_v_B = 0;
9090 PyObject *__pyx_v_B_is_identity = 0;
9091 int __pyx_lineno = 0;
9092 const char *__pyx_filename = NULL;
9093 int __pyx_clineno = 0;
9094 PyObject *__pyx_r = 0;
9095 __Pyx_RefNannyDeclarations
9096 __Pyx_RefNannySetupContext(
"set_csc_matrix_float (wrapper)", 0);
9098 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
9099 PyObject* values[3] = {0,0,0};
9100 if (unlikely(__pyx_kwds)) {
9102 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9104 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9106 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9108 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9111 default:
goto __pyx_L5_argtuple_error;
9113 kw_args = PyDict_Size(__pyx_kwds);
9116 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
9117 else goto __pyx_L5_argtuple_error;
9120 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
9122 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_float", 1, 3, 3, 1); __PYX_ERR(0, 807, __pyx_L3_error)
9126 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
9128 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_float", 1, 3, 3, 2); __PYX_ERR(0, 807, __pyx_L3_error)
9131 if (unlikely(kw_args > 0)) {
9132 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_csc_matrix_float") < 0)) __PYX_ERR(0, 807, __pyx_L3_error)
9134 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
9135 goto __pyx_L5_argtuple_error;
9137 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9138 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9139 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9141 __pyx_v_A = values[0];
9142 __pyx_v_B = values[1];
9143 __pyx_v_B_is_identity = values[2];
9145 goto __pyx_L4_argument_unpacking_done;
9146 __pyx_L5_argtuple_error:;
9147 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_float", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 807, __pyx_L3_error)
9149 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
9150 __Pyx_RefNannyFinishContext();
9152 __pyx_L4_argument_unpacking_done:;
9153 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
9156 __Pyx_RefNannyFinishContext();
9160 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
9161 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
9162 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
9163 __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9164 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9165 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9166 __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9167 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9168 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9169 float *__pyx_v_A_data;
9170 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
9171 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
9172 float *__pyx_v_B_data;
9173 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_indices;
9174 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_index_pointer;
9175 PyObject *__pyx_r = NULL;
9176 __Pyx_TraceDeclarations
9177 __Pyx_RefNannyDeclarations
9178 PyObject *__pyx_t_1 = NULL;
9179 PyObject *__pyx_t_2 = NULL;
9180 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
9181 PyObject *__pyx_t_4 = NULL;
9182 PyObject *__pyx_t_5 = NULL;
9183 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
9184 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
9187 Py_ssize_t __pyx_t_10;
9189 int __pyx_lineno = 0;
9190 const char *__pyx_filename = NULL;
9191 int __pyx_clineno = 0;
9192 __Pyx_TraceFrameInit(__pyx_codeobj__15)
9193 __Pyx_RefNannySetupContext(
"set_csc_matrix_float", 0);
9194 __Pyx_TraceCall(
"set_csc_matrix_float", __pyx_f[0], 807, 0, __PYX_ERR(0, 807, __pyx_L1_error));
9203 __Pyx_TraceLine(812,0,__PYX_ERR(0, 812, __pyx_L1_error))
9204 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error)
9205 __Pyx_GOTREF(__pyx_t_1);
9206 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 812, __pyx_L1_error)
9207 __Pyx_GOTREF(__pyx_t_2);
9208 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9209 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 812, __pyx_L1_error)
9210 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9211 __pyx_v_A_num_rows = __pyx_t_3;
9220 __Pyx_TraceLine(813,0,__PYX_ERR(0, 813, __pyx_L1_error))
9221 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error)
9222 __Pyx_GOTREF(__pyx_t_2);
9223 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error)
9224 __Pyx_GOTREF(__pyx_t_1);
9225 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9226 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 813, __pyx_L1_error)
9227 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9228 __pyx_v_A_num_columns = __pyx_t_3;
9237 __Pyx_TraceLine(817,0,__PYX_ERR(0, 817, __pyx_L1_error))
9238 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
9239 __Pyx_GOTREF(__pyx_t_1);
9240 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error)
9241 __Pyx_GOTREF(__pyx_t_2);
9242 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9243 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
9244 __Pyx_GOTREF(__pyx_t_1);
9245 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error)
9246 __Pyx_GOTREF(__pyx_t_4);
9247 __Pyx_GIVEREF(__pyx_t_1);
9248 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
9250 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
9251 __Pyx_GOTREF(__pyx_t_1);
9252 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 817, __pyx_L1_error)
9253 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L1_error)
9254 __Pyx_GOTREF(__pyx_t_5);
9255 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9256 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9257 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9266 __Pyx_TraceLine(816,0,__PYX_ERR(0, 816, __pyx_L1_error))
9267 __Pyx_GIVEREF(__pyx_t_5);
9268 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
9269 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
9270 __pyx_v_self->A_indices_copy = __pyx_t_5;
9280 __Pyx_TraceLine(819,0,__PYX_ERR(0, 819, __pyx_L1_error))
9281 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
9282 __Pyx_GOTREF(__pyx_t_5);
9283 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
9284 __Pyx_GOTREF(__pyx_t_1);
9285 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9286 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
9287 __Pyx_GOTREF(__pyx_t_5);
9288 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __pyx_L1_error)
9289 __Pyx_GOTREF(__pyx_t_4);
9290 __Pyx_GIVEREF(__pyx_t_5);
9291 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9293 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
9294 __Pyx_GOTREF(__pyx_t_5);
9295 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 819, __pyx_L1_error)
9296 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error)
9297 __Pyx_GOTREF(__pyx_t_2);
9298 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9299 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9300 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9309 __Pyx_TraceLine(818,0,__PYX_ERR(0, 818, __pyx_L1_error))
9310 __Pyx_GIVEREF(__pyx_t_2);
9311 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
9312 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
9313 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
9323 __Pyx_TraceLine(822,0,__PYX_ERR(0, 822, __pyx_L1_error))
9324 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error)
9325 __Pyx_GOTREF(__pyx_t_2);
9326 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 822, __pyx_L1_error)
9327 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9328 __pyx_v_A_data_mv = __pyx_t_6;
9329 __pyx_t_6.memview = NULL;
9330 __pyx_t_6.data = NULL;
9339 __Pyx_TraceLine(823,0,__PYX_ERR(0, 823, __pyx_L1_error))
9340 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 823, __pyx_L1_error)
9341 __pyx_v_A_indices_mv = __pyx_t_7;
9342 __pyx_t_7.memview = NULL;
9343 __pyx_t_7.data = NULL;
9352 __Pyx_TraceLine(825,0,__PYX_ERR(0, 825, __pyx_L1_error))
9353 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 825, __pyx_L1_error)
9354 __pyx_v_A_index_pointer_mv = __pyx_t_7;
9355 __pyx_t_7.memview = NULL;
9356 __pyx_t_7.data = NULL;
9365 __Pyx_TraceLine(826,0,__PYX_ERR(0, 826, __pyx_L1_error))
9366 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 826, __pyx_L1_error)
9367 __pyx_v_B_data_mv = __pyx_t_6;
9368 __pyx_t_6.memview = NULL;
9369 __pyx_t_6.data = NULL;
9378 __Pyx_TraceLine(827,0,__PYX_ERR(0, 827, __pyx_L1_error))
9379 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 827, __pyx_L1_error)
9380 __pyx_v_B_indices_mv = __pyx_t_7;
9381 __pyx_t_7.memview = NULL;
9382 __pyx_t_7.data = NULL;
9391 __Pyx_TraceLine(828,0,__PYX_ERR(0, 828, __pyx_L1_error))
9392 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 828, __pyx_L1_error)
9393 __pyx_v_B_index_pointer_mv = __pyx_t_7;
9394 __pyx_t_7.memview = NULL;
9395 __pyx_t_7.data = NULL;
9404 __Pyx_TraceLine(830,0,__PYX_ERR(0, 830, __pyx_L1_error))
9405 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 830, __pyx_L1_error)
9406 __pyx_t_9 = ((!__pyx_t_8) != 0);
9416 __Pyx_TraceLine(834,0,__PYX_ERR(0, 834, __pyx_L1_error))
9417 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
9418 __Pyx_GOTREF(__pyx_t_2);
9419 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 834, __pyx_L1_error)
9420 __Pyx_GOTREF(__pyx_t_5);
9421 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9422 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
9423 __Pyx_GOTREF(__pyx_t_2);
9424 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 834, __pyx_L1_error)
9425 __Pyx_GOTREF(__pyx_t_4);
9426 __Pyx_GIVEREF(__pyx_t_2);
9427 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
9429 __pyx_t_2 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
9430 __Pyx_GOTREF(__pyx_t_2);
9431 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 834, __pyx_L1_error)
9432 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error)
9433 __Pyx_GOTREF(__pyx_t_1);
9434 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9435 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9436 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9445 __Pyx_TraceLine(833,0,__PYX_ERR(0, 833, __pyx_L1_error))
9446 __Pyx_GIVEREF(__pyx_t_1);
9447 __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
9448 __Pyx_DECREF(__pyx_v_self->B_indices_copy);
9449 __pyx_v_self->B_indices_copy = __pyx_t_1;
9459 __Pyx_TraceLine(836,0,__PYX_ERR(0, 836, __pyx_L1_error))
9460 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
9461 __Pyx_GOTREF(__pyx_t_1);
9462 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __pyx_L1_error)
9463 __Pyx_GOTREF(__pyx_t_2);
9464 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9465 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
9466 __Pyx_GOTREF(__pyx_t_1);
9467 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L1_error)
9468 __Pyx_GOTREF(__pyx_t_4);
9469 __Pyx_GIVEREF(__pyx_t_1);
9470 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
9472 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
9473 __Pyx_GOTREF(__pyx_t_1);
9474 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 836, __pyx_L1_error)
9475 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 836, __pyx_L1_error)
9476 __Pyx_GOTREF(__pyx_t_5);
9477 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9478 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9488 __Pyx_TraceLine(835,0,__PYX_ERR(0, 835, __pyx_L1_error))
9489 __Pyx_GIVEREF(__pyx_t_5);
9490 __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
9491 __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
9492 __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
9502 __Pyx_TraceLine(838,0,__PYX_ERR(0, 838, __pyx_L1_error))
9503 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error)
9504 __Pyx_GOTREF(__pyx_t_5);
9505 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 838, __pyx_L1_error)
9506 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9507 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9508 __pyx_v_B_data_mv = __pyx_t_6;
9509 __pyx_t_6.memview = NULL;
9510 __pyx_t_6.data = NULL;
9519 __Pyx_TraceLine(839,0,__PYX_ERR(0, 839, __pyx_L1_error))
9520 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 839, __pyx_L1_error)
9521 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9522 __pyx_v_B_indices_mv = __pyx_t_7;
9523 __pyx_t_7.memview = NULL;
9524 __pyx_t_7.data = NULL;
9533 __Pyx_TraceLine(840,0,__PYX_ERR(0, 840, __pyx_L1_error))
9534 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 840, __pyx_L1_error)
9535 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9536 __pyx_v_B_index_pointer_mv = __pyx_t_7;
9537 __pyx_t_7.memview = NULL;
9538 __pyx_t_7.data = NULL;
9556 __Pyx_TraceLine(843,0,__PYX_ERR(0, 843, __pyx_L1_error))
9558 __pyx_v_A_data = (&(*((
float *) ( (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
9567 __Pyx_TraceLine(844,0,__PYX_ERR(0, 844, __pyx_L1_error))
9569 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
9578 __Pyx_TraceLine(845,0,__PYX_ERR(0, 845, __pyx_L1_error))
9580 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
9589 __Pyx_TraceLine(846,0,__PYX_ERR(0, 846, __pyx_L1_error))
9590 __pyx_v_B_data = NULL;
9599 __Pyx_TraceLine(847,0,__PYX_ERR(0, 847, __pyx_L1_error))
9600 __pyx_v_B_indices = NULL;
9609 __Pyx_TraceLine(848,0,__PYX_ERR(0, 848, __pyx_L1_error))
9610 __pyx_v_B_index_pointer = NULL;
9619 __Pyx_TraceLine(850,0,__PYX_ERR(0, 850, __pyx_L1_error))
9620 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 850, __pyx_L1_error)
9621 __pyx_t_8 = ((!__pyx_t_9) != 0);
9631 __Pyx_TraceLine(851,0,__PYX_ERR(0, 851, __pyx_L1_error))
9633 __pyx_v_B_data = (&(*((
float *) ( (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
9642 __Pyx_TraceLine(852,0,__PYX_ERR(0, 852, __pyx_L1_error))
9644 __pyx_v_B_indices = (&(*((
int *) ( (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
9653 __Pyx_TraceLine(853,0,__PYX_ERR(0, 853, __pyx_L1_error))
9655 __pyx_v_B_index_pointer = (&(*((
int *) ( (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
9673 __Pyx_TraceLine(856,0,__PYX_ERR(0, 856, __pyx_L1_error))
9674 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 856, __pyx_L1_error)
9684 __Pyx_TraceLine(857,0,__PYX_ERR(0, 857, __pyx_L1_error))
9686 __pyx_t_11 =
new cCSCAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
9688 __Pyx_CppExn2PyErr();
9689 __PYX_ERR(0, 857, __pyx_L1_error)
9691 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
9710 __Pyx_TraceLine(864,0,__PYX_ERR(0, 864, __pyx_L1_error))
9720 __Pyx_TraceLine(872,0,__PYX_ERR(0, 872, __pyx_L1_error))
9722 __pyx_t_11 =
new cCSCAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
9724 __Pyx_CppExn2PyErr();
9725 __PYX_ERR(0, 864, __pyx_L1_error)
9735 __Pyx_TraceLine(864,0,__PYX_ERR(0, 864, __pyx_L1_error))
9736 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
9749 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9752 __Pyx_XDECREF(__pyx_t_1);
9753 __Pyx_XDECREF(__pyx_t_2);
9754 __Pyx_XDECREF(__pyx_t_4);
9755 __Pyx_XDECREF(__pyx_t_5);
9756 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
9757 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
9758 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
9761 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
9762 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
9763 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
9764 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9765 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9766 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9767 __Pyx_XGIVEREF(__pyx_r);
9768 __Pyx_TraceReturn(__pyx_r, 0);
9769 __Pyx_RefNannyFinishContext();
9782 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9783 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double[] =
"pycAffineMatrixFunction.set_csc_matrix_double(self, A, B, B_is_identity)\n\n ";
9784 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double = {
"set_csc_matrix_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double};
9785 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9786 PyObject *__pyx_v_A = 0;
9787 PyObject *__pyx_v_B = 0;
9788 PyObject *__pyx_v_B_is_identity = 0;
9789 int __pyx_lineno = 0;
9790 const char *__pyx_filename = NULL;
9791 int __pyx_clineno = 0;
9792 PyObject *__pyx_r = 0;
9793 __Pyx_RefNannyDeclarations
9794 __Pyx_RefNannySetupContext(
"set_csc_matrix_double (wrapper)", 0);
9796 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
9797 PyObject* values[3] = {0,0,0};
9798 if (unlikely(__pyx_kwds)) {
9800 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9802 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9804 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9806 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9809 default:
goto __pyx_L5_argtuple_error;
9811 kw_args = PyDict_Size(__pyx_kwds);
9814 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
9815 else goto __pyx_L5_argtuple_error;
9818 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
9820 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_double", 1, 3, 3, 1); __PYX_ERR(0, 878, __pyx_L3_error)
9824 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
9826 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_double", 1, 3, 3, 2); __PYX_ERR(0, 878, __pyx_L3_error)
9829 if (unlikely(kw_args > 0)) {
9830 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_csc_matrix_double") < 0)) __PYX_ERR(0, 878, __pyx_L3_error)
9832 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
9833 goto __pyx_L5_argtuple_error;
9835 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9836 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9837 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9839 __pyx_v_A = values[0];
9840 __pyx_v_B = values[1];
9841 __pyx_v_B_is_identity = values[2];
9843 goto __pyx_L4_argument_unpacking_done;
9844 __pyx_L5_argtuple_error:;
9845 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 878, __pyx_L3_error)
9847 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
9848 __Pyx_RefNannyFinishContext();
9850 __pyx_L4_argument_unpacking_done:;
9851 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
9854 __Pyx_RefNannyFinishContext();
9858 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
9859 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
9860 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
9861 __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9862 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9863 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9864 __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9865 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9866 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9867 double *__pyx_v_A_data;
9868 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
9869 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
9870 double *__pyx_v_B_data;
9871 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_indices;
9872 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_index_pointer;
9873 PyObject *__pyx_r = NULL;
9874 __Pyx_TraceDeclarations
9875 __Pyx_RefNannyDeclarations
9876 PyObject *__pyx_t_1 = NULL;
9877 PyObject *__pyx_t_2 = NULL;
9878 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
9879 PyObject *__pyx_t_4 = NULL;
9880 PyObject *__pyx_t_5 = NULL;
9881 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
9882 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
9885 Py_ssize_t __pyx_t_10;
9887 int __pyx_lineno = 0;
9888 const char *__pyx_filename = NULL;
9889 int __pyx_clineno = 0;
9890 __Pyx_TraceFrameInit(__pyx_codeobj__16)
9891 __Pyx_RefNannySetupContext(
"set_csc_matrix_double", 0);
9892 __Pyx_TraceCall(
"set_csc_matrix_double", __pyx_f[0], 878, 0, __PYX_ERR(0, 878, __pyx_L1_error));
9901 __Pyx_TraceLine(883,0,__PYX_ERR(0, 883, __pyx_L1_error))
9902 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error)
9903 __Pyx_GOTREF(__pyx_t_1);
9904 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error)
9905 __Pyx_GOTREF(__pyx_t_2);
9906 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9907 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error)
9908 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9909 __pyx_v_A_num_rows = __pyx_t_3;
9918 __Pyx_TraceLine(884,0,__PYX_ERR(0, 884, __pyx_L1_error))
9919 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error)
9920 __Pyx_GOTREF(__pyx_t_2);
9921 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
9922 __Pyx_GOTREF(__pyx_t_1);
9923 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9924 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
9925 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9926 __pyx_v_A_num_columns = __pyx_t_3;
9935 __Pyx_TraceLine(888,0,__PYX_ERR(0, 888, __pyx_L1_error))
9936 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
9937 __Pyx_GOTREF(__pyx_t_1);
9938 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error)
9939 __Pyx_GOTREF(__pyx_t_2);
9940 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9941 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
9942 __Pyx_GOTREF(__pyx_t_1);
9943 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error)
9944 __Pyx_GOTREF(__pyx_t_4);
9945 __Pyx_GIVEREF(__pyx_t_1);
9946 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
9948 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
9949 __Pyx_GOTREF(__pyx_t_1);
9950 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
9951 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 888, __pyx_L1_error)
9952 __Pyx_GOTREF(__pyx_t_5);
9953 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9954 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9955 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9964 __Pyx_TraceLine(887,0,__PYX_ERR(0, 887, __pyx_L1_error))
9965 __Pyx_GIVEREF(__pyx_t_5);
9966 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
9967 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
9968 __pyx_v_self->A_indices_copy = __pyx_t_5;
9978 __Pyx_TraceLine(890,0,__PYX_ERR(0, 890, __pyx_L1_error))
9979 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
9980 __Pyx_GOTREF(__pyx_t_5);
9981 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error)
9982 __Pyx_GOTREF(__pyx_t_1);
9983 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9984 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
9985 __Pyx_GOTREF(__pyx_t_5);
9986 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error)
9987 __Pyx_GOTREF(__pyx_t_4);
9988 __Pyx_GIVEREF(__pyx_t_5);
9989 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9991 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
9992 __Pyx_GOTREF(__pyx_t_5);
9993 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 890, __pyx_L1_error)
9994 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 890, __pyx_L1_error)
9995 __Pyx_GOTREF(__pyx_t_2);
9996 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9997 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9998 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10007 __Pyx_TraceLine(889,0,__PYX_ERR(0, 889, __pyx_L1_error))
10008 __Pyx_GIVEREF(__pyx_t_2);
10009 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
10010 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
10011 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
10021 __Pyx_TraceLine(893,0,__PYX_ERR(0, 893, __pyx_L1_error))
10022 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __pyx_L1_error)
10023 __Pyx_GOTREF(__pyx_t_2);
10024 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 893, __pyx_L1_error)
10025 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10026 __pyx_v_A_data_mv = __pyx_t_6;
10027 __pyx_t_6.memview = NULL;
10028 __pyx_t_6.data = NULL;
10037 __Pyx_TraceLine(894,0,__PYX_ERR(0, 894, __pyx_L1_error))
10038 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 894, __pyx_L1_error)
10039 __pyx_v_A_indices_mv = __pyx_t_7;
10040 __pyx_t_7.memview = NULL;
10041 __pyx_t_7.data = NULL;
10050 __Pyx_TraceLine(896,0,__PYX_ERR(0, 896, __pyx_L1_error))
10051 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 896, __pyx_L1_error)
10052 __pyx_v_A_index_pointer_mv = __pyx_t_7;
10053 __pyx_t_7.memview = NULL;
10054 __pyx_t_7.data = NULL;
10063 __Pyx_TraceLine(897,0,__PYX_ERR(0, 897, __pyx_L1_error))
10064 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 897, __pyx_L1_error)
10065 __pyx_v_B_data_mv = __pyx_t_6;
10066 __pyx_t_6.memview = NULL;
10067 __pyx_t_6.data = NULL;
10076 __Pyx_TraceLine(898,0,__PYX_ERR(0, 898, __pyx_L1_error))
10077 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 898, __pyx_L1_error)
10078 __pyx_v_B_indices_mv = __pyx_t_7;
10079 __pyx_t_7.memview = NULL;
10080 __pyx_t_7.data = NULL;
10089 __Pyx_TraceLine(899,0,__PYX_ERR(0, 899, __pyx_L1_error))
10090 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 899, __pyx_L1_error)
10091 __pyx_v_B_index_pointer_mv = __pyx_t_7;
10092 __pyx_t_7.memview = NULL;
10093 __pyx_t_7.data = NULL;
10102 __Pyx_TraceLine(901,0,__PYX_ERR(0, 901, __pyx_L1_error))
10103 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
10104 __pyx_t_9 = ((!__pyx_t_8) != 0);
10114 __Pyx_TraceLine(905,0,__PYX_ERR(0, 905, __pyx_L1_error))
10115 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
10116 __Pyx_GOTREF(__pyx_t_2);
10117 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 905, __pyx_L1_error)
10118 __Pyx_GOTREF(__pyx_t_5);
10119 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10120 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
10121 __Pyx_GOTREF(__pyx_t_2);
10122 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L1_error)
10123 __Pyx_GOTREF(__pyx_t_4);
10124 __Pyx_GIVEREF(__pyx_t_2);
10125 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
10127 __pyx_t_2 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
10128 __Pyx_GOTREF(__pyx_t_2);
10129 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 905, __pyx_L1_error)
10130 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
10131 __Pyx_GOTREF(__pyx_t_1);
10132 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10133 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10134 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10143 __Pyx_TraceLine(904,0,__PYX_ERR(0, 904, __pyx_L1_error))
10144 __Pyx_GIVEREF(__pyx_t_1);
10145 __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
10146 __Pyx_DECREF(__pyx_v_self->B_indices_copy);
10147 __pyx_v_self->B_indices_copy = __pyx_t_1;
10157 __Pyx_TraceLine(907,0,__PYX_ERR(0, 907, __pyx_L1_error))
10158 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
10159 __Pyx_GOTREF(__pyx_t_1);
10160 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
10161 __Pyx_GOTREF(__pyx_t_2);
10162 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10163 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
10164 __Pyx_GOTREF(__pyx_t_1);
10165 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error)
10166 __Pyx_GOTREF(__pyx_t_4);
10167 __Pyx_GIVEREF(__pyx_t_1);
10168 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10170 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
10171 __Pyx_GOTREF(__pyx_t_1);
10172 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 907, __pyx_L1_error)
10173 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error)
10174 __Pyx_GOTREF(__pyx_t_5);
10175 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10176 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10177 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10186 __Pyx_TraceLine(906,0,__PYX_ERR(0, 906, __pyx_L1_error))
10187 __Pyx_GIVEREF(__pyx_t_5);
10188 __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
10189 __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
10190 __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
10200 __Pyx_TraceLine(909,0,__PYX_ERR(0, 909, __pyx_L1_error))
10201 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 909, __pyx_L1_error)
10202 __Pyx_GOTREF(__pyx_t_5);
10203 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_5, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 909, __pyx_L1_error)
10204 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10205 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
10206 __pyx_v_B_data_mv = __pyx_t_6;
10207 __pyx_t_6.memview = NULL;
10208 __pyx_t_6.data = NULL;
10217 __Pyx_TraceLine(910,0,__PYX_ERR(0, 910, __pyx_L1_error))
10218 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 910, __pyx_L1_error)
10219 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
10220 __pyx_v_B_indices_mv = __pyx_t_7;
10221 __pyx_t_7.memview = NULL;
10222 __pyx_t_7.data = NULL;
10231 __Pyx_TraceLine(911,0,__PYX_ERR(0, 911, __pyx_L1_error))
10232 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 911, __pyx_L1_error)
10233 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
10234 __pyx_v_B_index_pointer_mv = __pyx_t_7;
10235 __pyx_t_7.memview = NULL;
10236 __pyx_t_7.data = NULL;
10254 __Pyx_TraceLine(914,0,__PYX_ERR(0, 914, __pyx_L1_error))
10256 __pyx_v_A_data = (&(*((
double *) ( (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
10265 __Pyx_TraceLine(915,0,__PYX_ERR(0, 915, __pyx_L1_error))
10267 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
10276 __Pyx_TraceLine(916,0,__PYX_ERR(0, 916, __pyx_L1_error))
10278 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
10287 __Pyx_TraceLine(917,0,__PYX_ERR(0, 917, __pyx_L1_error))
10288 __pyx_v_B_data = NULL;
10297 __Pyx_TraceLine(918,0,__PYX_ERR(0, 918, __pyx_L1_error))
10298 __pyx_v_B_indices = NULL;
10307 __Pyx_TraceLine(919,0,__PYX_ERR(0, 919, __pyx_L1_error))
10308 __pyx_v_B_index_pointer = NULL;
10317 __Pyx_TraceLine(921,0,__PYX_ERR(0, 921, __pyx_L1_error))
10318 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 921, __pyx_L1_error)
10319 __pyx_t_8 = ((!__pyx_t_9) != 0);
10329 __Pyx_TraceLine(922,0,__PYX_ERR(0, 922, __pyx_L1_error))
10331 __pyx_v_B_data = (&(*((
double *) ( (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
10340 __Pyx_TraceLine(923,0,__PYX_ERR(0, 923, __pyx_L1_error))
10342 __pyx_v_B_indices = (&(*((
int *) ( (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
10351 __Pyx_TraceLine(924,0,__PYX_ERR(0, 924, __pyx_L1_error))
10353 __pyx_v_B_index_pointer = (&(*((
int *) ( (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
10371 __Pyx_TraceLine(927,0,__PYX_ERR(0, 927, __pyx_L1_error))
10372 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 927, __pyx_L1_error)
10382 __Pyx_TraceLine(928,0,__PYX_ERR(0, 928, __pyx_L1_error))
10384 __pyx_t_11 =
new cCSCAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
10386 __Pyx_CppExn2PyErr();
10387 __PYX_ERR(0, 928, __pyx_L1_error)
10389 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
10408 __Pyx_TraceLine(935,0,__PYX_ERR(0, 935, __pyx_L1_error))
10418 __Pyx_TraceLine(943,0,__PYX_ERR(0, 943, __pyx_L1_error))
10420 __pyx_t_11 =
new cCSCAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
10422 __Pyx_CppExn2PyErr();
10423 __PYX_ERR(0, 935, __pyx_L1_error)
10433 __Pyx_TraceLine(935,0,__PYX_ERR(0, 935, __pyx_L1_error))
10434 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
10447 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10450 __Pyx_XDECREF(__pyx_t_1);
10451 __Pyx_XDECREF(__pyx_t_2);
10452 __Pyx_XDECREF(__pyx_t_4);
10453 __Pyx_XDECREF(__pyx_t_5);
10454 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
10455 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
10456 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
10459 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
10460 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
10461 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
10462 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
10463 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
10464 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
10465 __Pyx_XGIVEREF(__pyx_r);
10466 __Pyx_TraceReturn(__pyx_r, 0);
10467 __Pyx_RefNannyFinishContext();
10480 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10481 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double[] =
"pycAffineMatrixFunction.set_csc_matrix_long_double(self, A, B, B_is_identity)\n\n ";
10482 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double = {
"set_csc_matrix_long_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double};
10483 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10484 PyObject *__pyx_v_A = 0;
10485 PyObject *__pyx_v_B = 0;
10486 PyObject *__pyx_v_B_is_identity = 0;
10487 int __pyx_lineno = 0;
10488 const char *__pyx_filename = NULL;
10489 int __pyx_clineno = 0;
10490 PyObject *__pyx_r = 0;
10491 __Pyx_RefNannyDeclarations
10492 __Pyx_RefNannySetupContext(
"set_csc_matrix_long_double (wrapper)", 0);
10494 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
10495 PyObject* values[3] = {0,0,0};
10496 if (unlikely(__pyx_kwds)) {
10497 Py_ssize_t kw_args;
10498 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10499 switch (pos_args) {
10500 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10501 CYTHON_FALLTHROUGH;
10502 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10503 CYTHON_FALLTHROUGH;
10504 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10505 CYTHON_FALLTHROUGH;
10507 default:
goto __pyx_L5_argtuple_error;
10509 kw_args = PyDict_Size(__pyx_kwds);
10510 switch (pos_args) {
10512 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
10513 else goto __pyx_L5_argtuple_error;
10514 CYTHON_FALLTHROUGH;
10516 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
10518 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_long_double", 1, 3, 3, 1); __PYX_ERR(0, 949, __pyx_L3_error)
10520 CYTHON_FALLTHROUGH;
10522 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
10524 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_long_double", 1, 3, 3, 2); __PYX_ERR(0, 949, __pyx_L3_error)
10527 if (unlikely(kw_args > 0)) {
10528 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_csc_matrix_long_double") < 0)) __PYX_ERR(0, 949, __pyx_L3_error)
10530 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
10531 goto __pyx_L5_argtuple_error;
10533 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10534 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10535 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10537 __pyx_v_A = values[0];
10538 __pyx_v_B = values[1];
10539 __pyx_v_B_is_identity = values[2];
10541 goto __pyx_L4_argument_unpacking_done;
10542 __pyx_L5_argtuple_error:;
10543 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_long_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 949, __pyx_L3_error)
10545 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
10546 __Pyx_RefNannyFinishContext();
10548 __pyx_L4_argument_unpacking_done:;
10549 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
10552 __Pyx_RefNannyFinishContext();
10556 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
10557 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
10558 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
10559 __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10560 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10561 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10562 __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10563 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10564 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10565 long double *__pyx_v_A_data;
10566 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
10567 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
10568 long double *__pyx_v_B_data;
10569 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_indices;
10570 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_index_pointer;
10571 PyObject *__pyx_r = NULL;
10572 __Pyx_TraceDeclarations
10573 __Pyx_RefNannyDeclarations
10574 PyObject *__pyx_t_1 = NULL;
10575 PyObject *__pyx_t_2 = NULL;
10576 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
10577 PyObject *__pyx_t_4 = NULL;
10578 PyObject *__pyx_t_5 = NULL;
10579 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
10580 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
10583 Py_ssize_t __pyx_t_10;
10585 int __pyx_lineno = 0;
10586 const char *__pyx_filename = NULL;
10587 int __pyx_clineno = 0;
10588 __Pyx_TraceFrameInit(__pyx_codeobj__17)
10589 __Pyx_RefNannySetupContext(
"set_csc_matrix_long_double", 0);
10590 __Pyx_TraceCall(
"set_csc_matrix_long_double", __pyx_f[0], 949, 0, __PYX_ERR(0, 949, __pyx_L1_error));
10599 __Pyx_TraceLine(954,0,__PYX_ERR(0, 954, __pyx_L1_error))
10600 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error)
10601 __Pyx_GOTREF(__pyx_t_1);
10602 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error)
10603 __Pyx_GOTREF(__pyx_t_2);
10604 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10605 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 954, __pyx_L1_error)
10606 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10607 __pyx_v_A_num_rows = __pyx_t_3;
10616 __Pyx_TraceLine(955,0,__PYX_ERR(0, 955, __pyx_L1_error))
10617 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error)
10618 __Pyx_GOTREF(__pyx_t_2);
10619 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error)
10620 __Pyx_GOTREF(__pyx_t_1);
10621 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10622 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L1_error)
10623 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10624 __pyx_v_A_num_columns = __pyx_t_3;
10633 __Pyx_TraceLine(959,0,__PYX_ERR(0, 959, __pyx_L1_error))
10634 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
10635 __Pyx_GOTREF(__pyx_t_1);
10636 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error)
10637 __Pyx_GOTREF(__pyx_t_2);
10638 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10639 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
10640 __Pyx_GOTREF(__pyx_t_1);
10641 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 959, __pyx_L1_error)
10642 __Pyx_GOTREF(__pyx_t_4);
10643 __Pyx_GIVEREF(__pyx_t_1);
10644 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10646 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
10647 __Pyx_GOTREF(__pyx_t_1);
10648 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
10649 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 959, __pyx_L1_error)
10650 __Pyx_GOTREF(__pyx_t_5);
10651 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10652 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10653 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10662 __Pyx_TraceLine(958,0,__PYX_ERR(0, 958, __pyx_L1_error))
10663 __Pyx_GIVEREF(__pyx_t_5);
10664 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
10665 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
10666 __pyx_v_self->A_indices_copy = __pyx_t_5;
10676 __Pyx_TraceLine(961,0,__PYX_ERR(0, 961, __pyx_L1_error))
10677 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
10678 __Pyx_GOTREF(__pyx_t_5);
10679 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
10680 __Pyx_GOTREF(__pyx_t_1);
10681 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10682 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
10683 __Pyx_GOTREF(__pyx_t_5);
10684 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 961, __pyx_L1_error)
10685 __Pyx_GOTREF(__pyx_t_4);
10686 __Pyx_GIVEREF(__pyx_t_5);
10687 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10689 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
10690 __Pyx_GOTREF(__pyx_t_5);
10691 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 961, __pyx_L1_error)
10692 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L1_error)
10693 __Pyx_GOTREF(__pyx_t_2);
10694 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10695 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10696 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10705 __Pyx_TraceLine(960,0,__PYX_ERR(0, 960, __pyx_L1_error))
10706 __Pyx_GIVEREF(__pyx_t_2);
10707 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
10708 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
10709 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
10719 __Pyx_TraceLine(964,0,__PYX_ERR(0, 964, __pyx_L1_error))
10720 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
10721 __Pyx_GOTREF(__pyx_t_2);
10722 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 964, __pyx_L1_error)
10723 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10724 __pyx_v_A_data_mv = __pyx_t_6;
10725 __pyx_t_6.memview = NULL;
10726 __pyx_t_6.data = NULL;
10735 __Pyx_TraceLine(965,0,__PYX_ERR(0, 965, __pyx_L1_error))
10736 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 965, __pyx_L1_error)
10737 __pyx_v_A_indices_mv = __pyx_t_7;
10738 __pyx_t_7.memview = NULL;
10739 __pyx_t_7.data = NULL;
10748 __Pyx_TraceLine(967,0,__PYX_ERR(0, 967, __pyx_L1_error))
10749 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 967, __pyx_L1_error)
10750 __pyx_v_A_index_pointer_mv = __pyx_t_7;
10751 __pyx_t_7.memview = NULL;
10752 __pyx_t_7.data = NULL;
10761 __Pyx_TraceLine(968,0,__PYX_ERR(0, 968, __pyx_L1_error))
10762 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 968, __pyx_L1_error)
10763 __pyx_v_B_data_mv = __pyx_t_6;
10764 __pyx_t_6.memview = NULL;
10765 __pyx_t_6.data = NULL;
10774 __Pyx_TraceLine(969,0,__PYX_ERR(0, 969, __pyx_L1_error))
10775 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 969, __pyx_L1_error)
10776 __pyx_v_B_indices_mv = __pyx_t_7;
10777 __pyx_t_7.memview = NULL;
10778 __pyx_t_7.data = NULL;
10787 __Pyx_TraceLine(970,0,__PYX_ERR(0, 970, __pyx_L1_error))
10788 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 970, __pyx_L1_error)
10789 __pyx_v_B_index_pointer_mv = __pyx_t_7;
10790 __pyx_t_7.memview = NULL;
10791 __pyx_t_7.data = NULL;
10800 __Pyx_TraceLine(972,0,__PYX_ERR(0, 972, __pyx_L1_error))
10801 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 972, __pyx_L1_error)
10802 __pyx_t_9 = ((!__pyx_t_8) != 0);
10812 __Pyx_TraceLine(976,0,__PYX_ERR(0, 976, __pyx_L1_error))
10813 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
10814 __Pyx_GOTREF(__pyx_t_2);
10815 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __pyx_L1_error)
10816 __Pyx_GOTREF(__pyx_t_5);
10817 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10818 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
10819 __Pyx_GOTREF(__pyx_t_2);
10820 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error)
10821 __Pyx_GOTREF(__pyx_t_4);
10822 __Pyx_GIVEREF(__pyx_t_2);
10823 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
10825 __pyx_t_2 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
10826 __Pyx_GOTREF(__pyx_t_2);
10827 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 976, __pyx_L1_error)
10828 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
10829 __Pyx_GOTREF(__pyx_t_1);
10830 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10831 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10832 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10841 __Pyx_TraceLine(975,0,__PYX_ERR(0, 975, __pyx_L1_error))
10842 __Pyx_GIVEREF(__pyx_t_1);
10843 __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
10844 __Pyx_DECREF(__pyx_v_self->B_indices_copy);
10845 __pyx_v_self->B_indices_copy = __pyx_t_1;
10855 __Pyx_TraceLine(978,0,__PYX_ERR(0, 978, __pyx_L1_error))
10856 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
10857 __Pyx_GOTREF(__pyx_t_1);
10858 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
10859 __Pyx_GOTREF(__pyx_t_2);
10860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10861 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
10862 __Pyx_GOTREF(__pyx_t_1);
10863 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L1_error)
10864 __Pyx_GOTREF(__pyx_t_4);
10865 __Pyx_GIVEREF(__pyx_t_1);
10866 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10868 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
10869 __Pyx_GOTREF(__pyx_t_1);
10870 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 978, __pyx_L1_error)
10871 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L1_error)
10872 __Pyx_GOTREF(__pyx_t_5);
10873 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10874 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10875 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10884 __Pyx_TraceLine(977,0,__PYX_ERR(0, 977, __pyx_L1_error))
10885 __Pyx_GIVEREF(__pyx_t_5);
10886 __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
10887 __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
10888 __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
10898 __Pyx_TraceLine(980,0,__PYX_ERR(0, 980, __pyx_L1_error))
10899 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 980, __pyx_L1_error)
10900 __Pyx_GOTREF(__pyx_t_5);
10901 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_5, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 980, __pyx_L1_error)
10902 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10903 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
10904 __pyx_v_B_data_mv = __pyx_t_6;
10905 __pyx_t_6.memview = NULL;
10906 __pyx_t_6.data = NULL;
10915 __Pyx_TraceLine(981,0,__PYX_ERR(0, 981, __pyx_L1_error))
10916 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 981, __pyx_L1_error)
10917 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
10918 __pyx_v_B_indices_mv = __pyx_t_7;
10919 __pyx_t_7.memview = NULL;
10920 __pyx_t_7.data = NULL;
10929 __Pyx_TraceLine(982,0,__PYX_ERR(0, 982, __pyx_L1_error))
10930 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 982, __pyx_L1_error)
10931 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
10932 __pyx_v_B_index_pointer_mv = __pyx_t_7;
10933 __pyx_t_7.memview = NULL;
10934 __pyx_t_7.data = NULL;
10952 __Pyx_TraceLine(985,0,__PYX_ERR(0, 985, __pyx_L1_error))
10954 __pyx_v_A_data = (&(*((
long double *) ( (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
10963 __Pyx_TraceLine(986,0,__PYX_ERR(0, 986, __pyx_L1_error))
10965 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
10974 __Pyx_TraceLine(987,0,__PYX_ERR(0, 987, __pyx_L1_error))
10976 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
10985 __Pyx_TraceLine(988,0,__PYX_ERR(0, 988, __pyx_L1_error))
10986 __pyx_v_B_data = NULL;
10995 __Pyx_TraceLine(989,0,__PYX_ERR(0, 989, __pyx_L1_error))
10996 __pyx_v_B_indices = NULL;
11005 __Pyx_TraceLine(990,0,__PYX_ERR(0, 990, __pyx_L1_error))
11006 __pyx_v_B_index_pointer = NULL;
11015 __Pyx_TraceLine(992,0,__PYX_ERR(0, 992, __pyx_L1_error))
11016 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 992, __pyx_L1_error)
11017 __pyx_t_8 = ((!__pyx_t_9) != 0);
11027 __Pyx_TraceLine(993,0,__PYX_ERR(0, 993, __pyx_L1_error))
11029 __pyx_v_B_data = (&(*((
long double *) ( (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
11038 __Pyx_TraceLine(994,0,__PYX_ERR(0, 994, __pyx_L1_error))
11040 __pyx_v_B_indices = (&(*((
int *) ( (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
11049 __Pyx_TraceLine(995,0,__PYX_ERR(0, 995, __pyx_L1_error))
11051 __pyx_v_B_index_pointer = (&(*((
int *) ( (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
11069 __Pyx_TraceLine(998,0,__PYX_ERR(0, 998, __pyx_L1_error))
11070 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 998, __pyx_L1_error)
11080 __Pyx_TraceLine(999,0,__PYX_ERR(0, 999, __pyx_L1_error))
11084 __Pyx_CppExn2PyErr();
11085 __PYX_ERR(0, 999, __pyx_L1_error)
11087 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
11106 __Pyx_TraceLine(1006,0,__PYX_ERR(0, 1006, __pyx_L1_error))
11114 __Pyx_TraceLine(1014,0,__PYX_ERR(0, 1014, __pyx_L1_error))
11116 __pyx_t_11 =
new cCSCAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
11118 __Pyx_CppExn2PyErr();
11119 __PYX_ERR(0, 1006, __pyx_L1_error)
11129 __Pyx_TraceLine(1006,0,__PYX_ERR(0, 1006, __pyx_L1_error))
11130 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
11143 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11146 __Pyx_XDECREF(__pyx_t_1);
11147 __Pyx_XDECREF(__pyx_t_2);
11148 __Pyx_XDECREF(__pyx_t_4);
11149 __Pyx_XDECREF(__pyx_t_5);
11150 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
11151 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
11152 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
11155 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
11156 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
11157 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
11158 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
11159 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
11160 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
11161 __Pyx_XGIVEREF(__pyx_r);
11162 __Pyx_TraceReturn(__pyx_r, 0);
11163 __Pyx_RefNannyFinishContext();
11174 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11175 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__[] =
"pycAffineMatrixFunction.__reduce_cython__(self)";
11176 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__};
11177 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11178 PyObject *__pyx_r = 0;
11179 __Pyx_RefNannyDeclarations
11180 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
11181 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self));
11184 __Pyx_RefNannyFinishContext();
11188 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self) {
11189 PyObject *__pyx_r = NULL;
11190 __Pyx_TraceDeclarations
11191 __Pyx_RefNannyDeclarations
11192 PyObject *__pyx_t_1 = NULL;
11193 int __pyx_lineno = 0;
11194 const char *__pyx_filename = NULL;
11195 int __pyx_clineno = 0;
11196 __Pyx_TraceFrameInit(__pyx_codeobj__18)
11197 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11198 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
11206 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
11207 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11208 __Pyx_GOTREF(__pyx_t_1);
11209 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11210 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11211 __PYX_ERR(1, 2, __pyx_L1_error)
11221 __Pyx_XDECREF(__pyx_t_1);
11222 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11224 __Pyx_XGIVEREF(__pyx_r);
11225 __Pyx_TraceReturn(__pyx_r, 0);
11226 __Pyx_RefNannyFinishContext();
11238 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11239 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__[] =
"pycAffineMatrixFunction.__setstate_cython__(self, __pyx_state)";
11240 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__};
11241 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11242 PyObject *__pyx_r = 0;
11243 __Pyx_RefNannyDeclarations
11244 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11245 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11248 __Pyx_RefNannyFinishContext();
11252 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11253 PyObject *__pyx_r = NULL;
11254 __Pyx_TraceDeclarations
11255 __Pyx_RefNannyDeclarations
11256 PyObject *__pyx_t_1 = NULL;
11257 int __pyx_lineno = 0;
11258 const char *__pyx_filename = NULL;
11259 int __pyx_clineno = 0;
11260 __Pyx_TraceFrameInit(__pyx_codeobj__20)
11261 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11262 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
11269 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
11270 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11271 __Pyx_GOTREF(__pyx_t_1);
11272 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11273 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11274 __PYX_ERR(1, 4, __pyx_L1_error)
11285 __Pyx_XDECREF(__pyx_t_1);
11286 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11288 __Pyx_XGIVEREF(__pyx_r);
11289 __Pyx_TraceReturn(__pyx_r, 0);
11290 __Pyx_RefNannyFinishContext();
11303 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11304 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11305 PyObject *__pyx_v_shape = 0;
11306 Py_ssize_t __pyx_v_itemsize;
11307 PyObject *__pyx_v_format = 0;
11308 PyObject *__pyx_v_mode = 0;
11309 int __pyx_v_allocate_buffer;
11310 int __pyx_lineno = 0;
11311 const char *__pyx_filename = NULL;
11312 int __pyx_clineno = 0;
11314 __Pyx_RefNannyDeclarations
11315 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
11317 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
11318 PyObject* values[5] = {0,0,0,0,0};
11319 values[3] = ((PyObject *)__pyx_n_s_c);
11320 if (unlikely(__pyx_kwds)) {
11321 Py_ssize_t kw_args;
11322 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11323 switch (pos_args) {
11324 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11325 CYTHON_FALLTHROUGH;
11326 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11327 CYTHON_FALLTHROUGH;
11328 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11329 CYTHON_FALLTHROUGH;
11330 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11331 CYTHON_FALLTHROUGH;
11332 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11333 CYTHON_FALLTHROUGH;
11335 default:
goto __pyx_L5_argtuple_error;
11337 kw_args = PyDict_Size(__pyx_kwds);
11338 switch (pos_args) {
11340 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
11341 else goto __pyx_L5_argtuple_error;
11342 CYTHON_FALLTHROUGH;
11344 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
11346 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
11348 CYTHON_FALLTHROUGH;
11350 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
11352 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
11354 CYTHON_FALLTHROUGH;
11357 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
11358 if (value) { values[3] = value; kw_args--; }
11360 CYTHON_FALLTHROUGH;
11363 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
11364 if (value) { values[4] = value; kw_args--; }
11367 if (unlikely(kw_args > 0)) {
11368 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
11371 switch (PyTuple_GET_SIZE(__pyx_args)) {
11372 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11373 CYTHON_FALLTHROUGH;
11374 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11375 CYTHON_FALLTHROUGH;
11376 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11377 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11378 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11380 default:
goto __pyx_L5_argtuple_error;
11383 __pyx_v_shape = ((PyObject*)values[0]);
11384 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
11385 __pyx_v_format = values[2];
11386 __pyx_v_mode = values[3];
11388 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
11398 __pyx_v_allocate_buffer = ((int)1);
11401 goto __pyx_L4_argument_unpacking_done;
11402 __pyx_L5_argtuple_error:;
11403 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
11405 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11406 __Pyx_RefNannyFinishContext();
11408 __pyx_L4_argument_unpacking_done:;
11409 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
11410 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
11411 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 122, __pyx_L1_error)
11413 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
11428 __Pyx_RefNannyFinishContext();
11432 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
11434 Py_ssize_t __pyx_v_i;
11435 Py_ssize_t __pyx_v_dim;
11436 PyObject **__pyx_v_p;
11437 char __pyx_v_order;
11439 __Pyx_TraceDeclarations
11440 __Pyx_RefNannyDeclarations
11441 Py_ssize_t __pyx_t_1;
11443 PyObject *__pyx_t_3 = NULL;
11445 PyObject *__pyx_t_5 = NULL;
11446 PyObject *__pyx_t_6 = NULL;
11449 Py_ssize_t __pyx_t_9;
11450 PyObject *__pyx_t_10 = NULL;
11451 Py_ssize_t __pyx_t_11;
11452 int __pyx_lineno = 0;
11453 const char *__pyx_filename = NULL;
11454 int __pyx_clineno = 0;
11455 __Pyx_RefNannySetupContext(
"__cinit__", 0);
11456 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error));
11457 __Pyx_INCREF(__pyx_v_format);
11466 __Pyx_TraceLine(129,0,__PYX_ERR(1, 129, __pyx_L1_error))
11467 if (unlikely(__pyx_v_shape == Py_None)) {
11468 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
11469 __PYX_ERR(1, 129, __pyx_L1_error)
11471 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
11472 __pyx_v_self->ndim = ((int)__pyx_t_1);
11481 __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
11482 __pyx_v_self->itemsize = __pyx_v_itemsize;
11491 __Pyx_TraceLine(132,0,__PYX_ERR(1, 132, __pyx_L1_error))
11492 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
11493 if (unlikely(__pyx_t_2)) {
11502 __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
11503 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
11504 __Pyx_GOTREF(__pyx_t_3);
11505 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11506 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11507 __PYX_ERR(1, 133, __pyx_L1_error)
11525 __Pyx_TraceLine(135,0,__PYX_ERR(1, 135, __pyx_L1_error))
11526 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
11527 if (unlikely(__pyx_t_2)) {
11536 __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
11537 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
11538 __Pyx_GOTREF(__pyx_t_3);
11539 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11540 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11541 __PYX_ERR(1, 136, __pyx_L1_error)
11559 __Pyx_TraceLine(138,0,__PYX_ERR(1, 138, __pyx_L1_error))
11560 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
11561 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
11571 __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
11572 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
11573 __Pyx_GOTREF(__pyx_t_5);
11575 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11576 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
11577 if (likely(__pyx_t_6)) {
11578 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11579 __Pyx_INCREF(__pyx_t_6);
11580 __Pyx_INCREF(
function);
11581 __Pyx_DECREF_SET(__pyx_t_5,
function);
11584 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
11585 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11586 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
11587 __Pyx_GOTREF(__pyx_t_3);
11588 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11589 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
11608 __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
11609 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
11610 __pyx_t_3 = __pyx_v_format;
11611 __Pyx_INCREF(__pyx_t_3);
11612 __Pyx_GIVEREF(__pyx_t_3);
11613 __Pyx_GOTREF(__pyx_v_self->_format);
11614 __Pyx_DECREF(__pyx_v_self->_format);
11615 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
11625 __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
11626 if (unlikely(__pyx_v_self->_format == Py_None)) {
11627 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
11628 __PYX_ERR(1, 141, __pyx_L1_error)
11630 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
11631 __pyx_v_self->format = __pyx_t_7;
11640 __Pyx_TraceLine(144,0,__PYX_ERR(1, 144, __pyx_L1_error))
11641 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
11650 __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
11651 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
11660 __Pyx_TraceLine(147,0,__PYX_ERR(1, 147, __pyx_L1_error))
11661 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
11662 if (unlikely(__pyx_t_4)) {
11671 __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
11672 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
11673 __Pyx_GOTREF(__pyx_t_3);
11674 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11675 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11676 __PYX_ERR(1, 148, __pyx_L1_error)
11694 __Pyx_TraceLine(151,0,__PYX_ERR(1, 151, __pyx_L1_error))
11696 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
11698 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
11699 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11700 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
11702 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
11703 __Pyx_GOTREF(__pyx_t_5);
11705 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
11706 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11707 __pyx_v_dim = __pyx_t_9;
11708 __pyx_v_idx = __pyx_t_8;
11709 __pyx_t_8 = (__pyx_t_8 + 1);
11718 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
11719 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
11720 if (unlikely(__pyx_t_4)) {
11729 __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
11730 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
11731 __Pyx_GOTREF(__pyx_t_5);
11732 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
11733 __Pyx_GOTREF(__pyx_t_6);
11734 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
11735 __Pyx_GOTREF(__pyx_t_10);
11736 __Pyx_GIVEREF(__pyx_t_5);
11737 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
11738 __Pyx_GIVEREF(__pyx_t_6);
11739 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
11742 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
11743 __Pyx_GOTREF(__pyx_t_6);
11744 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11745 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
11746 __Pyx_GOTREF(__pyx_t_10);
11747 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11748 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11749 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11750 __PYX_ERR(1, 153, __pyx_L1_error)
11768 __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
11769 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
11778 __Pyx_TraceLine(151,0,__PYX_ERR(1, 151, __pyx_L1_error))
11780 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11789 __Pyx_TraceLine(157,0,__PYX_ERR(1, 157, __pyx_L1_error))
11790 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
11800 __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
11801 __pyx_v_order =
'F';
11810 __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
11811 __Pyx_INCREF(__pyx_n_u_fortran);
11812 __Pyx_GIVEREF(__pyx_n_u_fortran);
11813 __Pyx_GOTREF(__pyx_v_self->mode);
11814 __Pyx_DECREF(__pyx_v_self->mode);
11815 __pyx_v_self->mode = __pyx_n_u_fortran;
11834 __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
11835 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
11836 if (likely(__pyx_t_4)) {
11845 __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
11846 __pyx_v_order =
'C';
11855 __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
11856 __Pyx_INCREF(__pyx_n_u_c);
11857 __Pyx_GIVEREF(__pyx_n_u_c);
11858 __Pyx_GOTREF(__pyx_v_self->mode);
11859 __Pyx_DECREF(__pyx_v_self->mode);
11860 __pyx_v_self->mode = __pyx_n_u_c;
11879 __Pyx_TraceLine(164,0,__PYX_ERR(1, 164, __pyx_L1_error))
11881 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
11882 __Pyx_GOTREF(__pyx_t_3);
11883 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
11884 __Pyx_GOTREF(__pyx_t_10);
11885 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11886 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11887 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11888 __PYX_ERR(1, 164, __pyx_L1_error)
11899 __Pyx_TraceLine(166,0,__PYX_ERR(1, 166, __pyx_L1_error))
11900 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
11909 __Pyx_TraceLine(169,0,__PYX_ERR(1, 169, __pyx_L1_error))
11910 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
11919 __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
11920 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
11921 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
11922 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11923 __pyx_v_self->dtype_is_object = __pyx_t_4;
11932 __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
11933 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
11943 __Pyx_TraceLine(174,0,__PYX_ERR(1, 174, __pyx_L1_error))
11944 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
11953 __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
11954 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
11955 if (unlikely(__pyx_t_4)) {
11964 __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
11965 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
11966 __Pyx_GOTREF(__pyx_t_10);
11967 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11968 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11969 __PYX_ERR(1, 176, __pyx_L1_error)
11987 __Pyx_TraceLine(178,0,__PYX_ERR(1, 178, __pyx_L1_error))
11988 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
11998 __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
11999 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
12008 __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
12009 if (unlikely(__pyx_v_itemsize == 0)) {
12010 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
12011 __PYX_ERR(1, 180, __pyx_L1_error)
12013 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
12014 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
12015 __PYX_ERR(1, 180, __pyx_L1_error)
12017 __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
12018 __pyx_t_9 = __pyx_t_1;
12019 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
12020 __pyx_v_i = __pyx_t_11;
12029 __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
12030 (__pyx_v_p[__pyx_v_i]) = Py_None;
12039 __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
12040 Py_INCREF(Py_None);
12073 __Pyx_XDECREF(__pyx_t_3);
12074 __Pyx_XDECREF(__pyx_t_5);
12075 __Pyx_XDECREF(__pyx_t_6);
12076 __Pyx_XDECREF(__pyx_t_10);
12077 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12080 __Pyx_XDECREF(__pyx_v_format);
12081 __Pyx_TraceReturn(Py_None, 0);
12082 __Pyx_RefNannyFinishContext();
12095 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
12096 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12098 __Pyx_RefNannyDeclarations
12099 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
12100 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
12103 __Pyx_RefNannyFinishContext();
12107 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12108 int __pyx_v_bufmode;
12110 __Pyx_TraceDeclarations
12111 __Pyx_RefNannyDeclarations
12114 PyObject *__pyx_t_3 = NULL;
12116 Py_ssize_t __pyx_t_5;
12118 Py_ssize_t *__pyx_t_7;
12119 int __pyx_lineno = 0;
12120 const char *__pyx_filename = NULL;
12121 int __pyx_clineno = 0;
12122 if (__pyx_v_info == NULL) {
12123 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
12126 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
12127 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12128 __Pyx_GIVEREF(__pyx_v_info->obj);
12129 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 185, 0, __PYX_ERR(1, 185, __pyx_L1_error));
12138 __Pyx_TraceLine(186,0,__PYX_ERR(1, 186, __pyx_L1_error))
12139 __pyx_v_bufmode = -1;
12148 __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
12149 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
12150 __pyx_t_2 = (__pyx_t_1 != 0);
12160 __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
12161 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
12180 __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
12181 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
12182 __pyx_t_1 = (__pyx_t_2 != 0);
12192 __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
12193 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
12212 __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
12213 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
12214 if (unlikely(__pyx_t_1)) {
12223 __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
12224 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
12225 __Pyx_GOTREF(__pyx_t_3);
12226 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12227 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12228 __PYX_ERR(1, 192, __pyx_L1_error)
12246 __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
12247 __pyx_t_4 = __pyx_v_self->data;
12248 __pyx_v_info->buf = __pyx_t_4;
12257 __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
12258 __pyx_t_5 = __pyx_v_self->len;
12259 __pyx_v_info->len = __pyx_t_5;
12268 __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
12269 __pyx_t_6 = __pyx_v_self->ndim;
12270 __pyx_v_info->ndim = __pyx_t_6;
12279 __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
12280 __pyx_t_7 = __pyx_v_self->_shape;
12281 __pyx_v_info->shape = __pyx_t_7;
12290 __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
12291 __pyx_t_7 = __pyx_v_self->_strides;
12292 __pyx_v_info->strides = __pyx_t_7;
12301 __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
12302 __pyx_v_info->suboffsets = NULL;
12311 __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
12312 __pyx_t_5 = __pyx_v_self->itemsize;
12313 __pyx_v_info->itemsize = __pyx_t_5;
12322 __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
12323 __pyx_v_info->readonly = 0;
12332 __Pyx_TraceLine(202,0,__PYX_ERR(1, 202, __pyx_L1_error))
12333 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12343 __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
12344 __pyx_t_4 = __pyx_v_self->format;
12345 __pyx_v_info->format = __pyx_t_4;
12364 __Pyx_TraceLine(205,0,__PYX_ERR(1, 205, __pyx_L1_error))
12366 __pyx_v_info->format = NULL;
12377 __Pyx_TraceLine(207,0,__PYX_ERR(1, 207, __pyx_L1_error))
12378 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12379 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12380 __Pyx_GOTREF(__pyx_v_info->obj);
12381 __Pyx_DECREF(__pyx_v_info->obj);
12382 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12396 __Pyx_XDECREF(__pyx_t_3);
12397 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12399 if (__pyx_v_info->obj != NULL) {
12400 __Pyx_GOTREF(__pyx_v_info->obj);
12401 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12405 if (__pyx_v_info->obj == Py_None) {
12406 __Pyx_GOTREF(__pyx_v_info->obj);
12407 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12410 __Pyx_TraceReturn(Py_None, 0);
12411 __Pyx_RefNannyFinishContext();
12424 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
12425 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
12426 __Pyx_RefNannyDeclarations
12427 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
12428 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
12431 __Pyx_RefNannyFinishContext();
12434 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
12435 __Pyx_TraceDeclarations
12436 __Pyx_RefNannyDeclarations
12438 int __pyx_lineno = 0;
12439 const char *__pyx_filename = NULL;
12440 int __pyx_clineno = 0;
12441 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
12442 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 211, 0, __PYX_ERR(1, 211, __pyx_L1_error));
12451 __Pyx_TraceLine(212,0,__PYX_ERR(1, 212, __pyx_L1_error))
12452 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
12462 __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
12463 __pyx_v_self->callback_free_data(__pyx_v_self->data);
12482 __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
12483 __pyx_t_1 = (__pyx_v_self->free_data != 0);
12493 __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
12494 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
12504 __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
12505 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
12523 __Pyx_TraceLine(218,0,__PYX_ERR(1, 218, __pyx_L1_error))
12524 free(__pyx_v_self->data);
12543 __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
12544 PyObject_Free(__pyx_v_self->_shape);
12557 __Pyx_WriteUnraisable(
"View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
12559 __Pyx_TraceReturn(Py_None, 0);
12560 __Pyx_RefNannyFinishContext();
12572 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
12573 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
12574 PyObject *__pyx_r = 0;
12575 __Pyx_RefNannyDeclarations
12576 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12577 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
12580 __Pyx_RefNannyFinishContext();
12584 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
12585 PyObject *__pyx_r = NULL;
12586 __Pyx_TraceDeclarations
12587 __Pyx_RefNannyDeclarations
12588 PyObject *__pyx_t_1 = NULL;
12589 int __pyx_lineno = 0;
12590 const char *__pyx_filename = NULL;
12591 int __pyx_clineno = 0;
12592 __Pyx_RefNannySetupContext(
"__get__", 0);
12593 __Pyx_TraceCall(
"__get__", __pyx_f[1], 222, 0, __PYX_ERR(1, 222, __pyx_L1_error));
12602 __Pyx_TraceLine(223,0,__PYX_ERR(1, 223, __pyx_L1_error))
12603 __Pyx_XDECREF(__pyx_r);
12604 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
12605 __Pyx_GOTREF(__pyx_t_1);
12606 __pyx_r = __pyx_t_1;
12620 __Pyx_XDECREF(__pyx_t_1);
12621 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12624 __Pyx_XGIVEREF(__pyx_r);
12625 __Pyx_TraceReturn(__pyx_r, 0);
12626 __Pyx_RefNannyFinishContext();
12638 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
12640 PyObject *__pyx_r = NULL;
12641 __Pyx_TraceDeclarations
12642 __Pyx_RefNannyDeclarations
12643 PyObject *__pyx_t_1 = NULL;
12644 PyObject *__pyx_t_2 = NULL;
12645 PyObject *__pyx_t_3 = NULL;
12646 int __pyx_lineno = 0;
12647 const char *__pyx_filename = NULL;
12648 int __pyx_clineno = 0;
12649 __Pyx_RefNannySetupContext(
"get_memview", 0);
12650 __Pyx_TraceCall(
"get_memview", __pyx_f[1], 226, 0, __PYX_ERR(1, 226, __pyx_L1_error));
12659 __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
12660 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
12669 __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
12670 __Pyx_XDECREF(__pyx_r);
12671 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
12672 __Pyx_GOTREF(__pyx_t_1);
12673 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
12674 __Pyx_GOTREF(__pyx_t_2);
12675 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
12676 __Pyx_GOTREF(__pyx_t_3);
12677 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12678 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12679 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
12680 __Pyx_GIVEREF(__pyx_t_1);
12681 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
12682 __Pyx_GIVEREF(__pyx_t_2);
12683 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
12686 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
12687 __Pyx_GOTREF(__pyx_t_2);
12688 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12689 __pyx_r = __pyx_t_2;
12703 __Pyx_XDECREF(__pyx_t_1);
12704 __Pyx_XDECREF(__pyx_t_2);
12705 __Pyx_XDECREF(__pyx_t_3);
12706 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
12709 __Pyx_XGIVEREF(__pyx_r);
12710 __Pyx_TraceReturn(__pyx_r, 0);
12711 __Pyx_RefNannyFinishContext();
12724 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
12725 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
12726 Py_ssize_t __pyx_r;
12727 __Pyx_RefNannyDeclarations
12728 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
12729 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
12732 __Pyx_RefNannyFinishContext();
12736 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
12737 Py_ssize_t __pyx_r;
12738 __Pyx_TraceDeclarations
12739 __Pyx_RefNannyDeclarations
12740 int __pyx_lineno = 0;
12741 const char *__pyx_filename = NULL;
12742 int __pyx_clineno = 0;
12743 __Pyx_RefNannySetupContext(
"__len__", 0);
12744 __Pyx_TraceCall(
"__len__", __pyx_f[1], 230, 0, __PYX_ERR(1, 230, __pyx_L1_error));
12753 __Pyx_TraceLine(231,0,__PYX_ERR(1, 231, __pyx_L1_error))
12754 __pyx_r = (__pyx_v_self->_shape[0]);
12767 __Pyx_AddTraceback(
"View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12770 __Pyx_TraceReturn(Py_None, 0);
12771 __Pyx_RefNannyFinishContext();
12784 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
12785 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
12786 PyObject *__pyx_r = 0;
12787 __Pyx_RefNannyDeclarations
12788 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
12789 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
12792 __Pyx_RefNannyFinishContext();
12796 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
12797 PyObject *__pyx_r = NULL;
12798 __Pyx_TraceDeclarations
12799 __Pyx_RefNannyDeclarations
12800 PyObject *__pyx_t_1 = NULL;
12801 PyObject *__pyx_t_2 = NULL;
12802 int __pyx_lineno = 0;
12803 const char *__pyx_filename = NULL;
12804 int __pyx_clineno = 0;
12805 __Pyx_RefNannySetupContext(
"__getattr__", 0);
12806 __Pyx_TraceCall(
"__getattr__", __pyx_f[1], 233, 0, __PYX_ERR(1, 233, __pyx_L1_error));
12815 __Pyx_TraceLine(234,0,__PYX_ERR(1, 234, __pyx_L1_error))
12816 __Pyx_XDECREF(__pyx_r);
12817 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
12818 __Pyx_GOTREF(__pyx_t_1);
12819 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
12820 __Pyx_GOTREF(__pyx_t_2);
12821 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12822 __pyx_r = __pyx_t_2;
12836 __Pyx_XDECREF(__pyx_t_1);
12837 __Pyx_XDECREF(__pyx_t_2);
12838 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12841 __Pyx_XGIVEREF(__pyx_r);
12842 __Pyx_TraceReturn(__pyx_r, 0);
12843 __Pyx_RefNannyFinishContext();
12856 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
12857 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
12858 PyObject *__pyx_r = 0;
12859 __Pyx_RefNannyDeclarations
12860 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
12861 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
12864 __Pyx_RefNannyFinishContext();
12868 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
12869 PyObject *__pyx_r = NULL;
12870 __Pyx_TraceDeclarations
12871 __Pyx_RefNannyDeclarations
12872 PyObject *__pyx_t_1 = NULL;
12873 PyObject *__pyx_t_2 = NULL;
12874 int __pyx_lineno = 0;
12875 const char *__pyx_filename = NULL;
12876 int __pyx_clineno = 0;
12877 __Pyx_RefNannySetupContext(
"__getitem__", 0);
12878 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 236, 0, __PYX_ERR(1, 236, __pyx_L1_error));
12887 __Pyx_TraceLine(237,0,__PYX_ERR(1, 237, __pyx_L1_error))
12888 __Pyx_XDECREF(__pyx_r);
12889 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
12890 __Pyx_GOTREF(__pyx_t_1);
12891 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
12892 __Pyx_GOTREF(__pyx_t_2);
12893 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12894 __pyx_r = __pyx_t_2;
12908 __Pyx_XDECREF(__pyx_t_1);
12909 __Pyx_XDECREF(__pyx_t_2);
12910 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12913 __Pyx_XGIVEREF(__pyx_r);
12914 __Pyx_TraceReturn(__pyx_r, 0);
12915 __Pyx_RefNannyFinishContext();
12928 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
12929 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
12931 __Pyx_RefNannyDeclarations
12932 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
12933 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
12936 __Pyx_RefNannyFinishContext();
12940 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
12942 __Pyx_TraceDeclarations
12943 __Pyx_RefNannyDeclarations
12944 PyObject *__pyx_t_1 = NULL;
12945 int __pyx_lineno = 0;
12946 const char *__pyx_filename = NULL;
12947 int __pyx_clineno = 0;
12948 __Pyx_RefNannySetupContext(
"__setitem__", 0);
12949 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 239, 0, __PYX_ERR(1, 239, __pyx_L1_error));
12958 __Pyx_TraceLine(240,0,__PYX_ERR(1, 240, __pyx_L1_error))
12959 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
12960 __Pyx_GOTREF(__pyx_t_1);
12961 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
12962 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12976 __Pyx_XDECREF(__pyx_t_1);
12977 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12980 __Pyx_TraceReturn(Py_None, 0);
12981 __Pyx_RefNannyFinishContext();
12992 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
12993 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
12994 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12995 PyObject *__pyx_r = 0;
12996 __Pyx_RefNannyDeclarations
12997 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
12998 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
13001 __Pyx_RefNannyFinishContext();
13005 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
13006 PyObject *__pyx_r = NULL;
13007 __Pyx_TraceDeclarations
13008 __Pyx_RefNannyDeclarations
13009 PyObject *__pyx_t_1 = NULL;
13010 int __pyx_lineno = 0;
13011 const char *__pyx_filename = NULL;
13012 int __pyx_clineno = 0;
13013 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
13014 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13022 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
13023 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
13024 __Pyx_GOTREF(__pyx_t_1);
13025 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13026 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13027 __PYX_ERR(1, 2, __pyx_L1_error)
13037 __Pyx_XDECREF(__pyx_t_1);
13038 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13040 __Pyx_XGIVEREF(__pyx_r);
13041 __Pyx_TraceReturn(__pyx_r, 0);
13042 __Pyx_RefNannyFinishContext();
13054 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
13055 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
13056 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13057 PyObject *__pyx_r = 0;
13058 __Pyx_RefNannyDeclarations
13059 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
13060 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13063 __Pyx_RefNannyFinishContext();
13067 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
13068 PyObject *__pyx_r = NULL;
13069 __Pyx_TraceDeclarations
13070 __Pyx_RefNannyDeclarations
13071 PyObject *__pyx_t_1 = NULL;
13072 int __pyx_lineno = 0;
13073 const char *__pyx_filename = NULL;
13074 int __pyx_clineno = 0;
13075 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
13076 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
13083 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
13084 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
13085 __Pyx_GOTREF(__pyx_t_1);
13086 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13087 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13088 __PYX_ERR(1, 4, __pyx_L1_error)
13099 __Pyx_XDECREF(__pyx_t_1);
13100 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13102 __Pyx_XGIVEREF(__pyx_r);
13103 __Pyx_TraceReturn(__pyx_r, 0);
13104 __Pyx_RefNannyFinishContext();
13116 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
13117 struct __pyx_array_obj *__pyx_v_result = 0;
13118 struct __pyx_array_obj *__pyx_r = NULL;
13119 __Pyx_TraceDeclarations
13120 __Pyx_RefNannyDeclarations
13122 PyObject *__pyx_t_2 = NULL;
13123 PyObject *__pyx_t_3 = NULL;
13124 PyObject *__pyx_t_4 = NULL;
13125 PyObject *__pyx_t_5 = NULL;
13126 int __pyx_lineno = 0;
13127 const char *__pyx_filename = NULL;
13128 int __pyx_clineno = 0;
13129 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
13130 __Pyx_TraceCall(
"array_cwrapper", __pyx_f[1], 244, 0, __PYX_ERR(1, 244, __pyx_L1_error));
13139 __Pyx_TraceLine(248,0,__PYX_ERR(1, 248, __pyx_L1_error))
13140 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
13150 __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
13151 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
13152 __Pyx_GOTREF(__pyx_t_2);
13153 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
13154 __Pyx_GOTREF(__pyx_t_3);
13155 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
13156 __Pyx_GOTREF(__pyx_t_4);
13157 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
13158 __Pyx_GOTREF(__pyx_t_5);
13159 __Pyx_INCREF(__pyx_v_shape);
13160 __Pyx_GIVEREF(__pyx_v_shape);
13161 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
13162 __Pyx_GIVEREF(__pyx_t_2);
13163 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
13164 __Pyx_GIVEREF(__pyx_t_3);
13165 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
13166 __Pyx_GIVEREF(__pyx_t_4);
13167 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
13171 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
13172 __Pyx_GOTREF(__pyx_t_4);
13173 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13174 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
13194 __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error))
13196 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
13197 __Pyx_GOTREF(__pyx_t_4);
13198 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
13199 __Pyx_GOTREF(__pyx_t_5);
13200 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
13201 __Pyx_GOTREF(__pyx_t_3);
13202 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
13203 __Pyx_GOTREF(__pyx_t_2);
13204 __Pyx_INCREF(__pyx_v_shape);
13205 __Pyx_GIVEREF(__pyx_v_shape);
13206 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
13207 __Pyx_GIVEREF(__pyx_t_4);
13208 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
13209 __Pyx_GIVEREF(__pyx_t_5);
13210 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
13211 __Pyx_GIVEREF(__pyx_t_3);
13212 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
13224 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
13225 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
13226 __Pyx_GOTREF(__pyx_t_3);
13227 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
13236 __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error))
13237 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
13238 __Pyx_GOTREF(__pyx_t_5);
13239 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13240 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13241 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
13251 __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
13252 __pyx_v_result->data = __pyx_v_buf;
13263 __Pyx_TraceLine(255,0,__PYX_ERR(1, 255, __pyx_L1_error))
13264 __Pyx_XDECREF(((PyObject *)__pyx_r));
13265 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13266 __pyx_r = __pyx_v_result;
13279 __Pyx_XDECREF(__pyx_t_2);
13280 __Pyx_XDECREF(__pyx_t_3);
13281 __Pyx_XDECREF(__pyx_t_4);
13282 __Pyx_XDECREF(__pyx_t_5);
13283 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13286 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13287 __Pyx_XGIVEREF((PyObject *)__pyx_r);
13288 __Pyx_TraceReturn(__pyx_r, 0);
13289 __Pyx_RefNannyFinishContext();
13302 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13303 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13304 PyObject *__pyx_v_name = 0;
13305 int __pyx_lineno = 0;
13306 const char *__pyx_filename = NULL;
13307 int __pyx_clineno = 0;
13309 __Pyx_RefNannyDeclarations
13310 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
13312 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
13313 PyObject* values[1] = {0};
13314 if (unlikely(__pyx_kwds)) {
13315 Py_ssize_t kw_args;
13316 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13317 switch (pos_args) {
13318 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13319 CYTHON_FALLTHROUGH;
13321 default:
goto __pyx_L5_argtuple_error;
13323 kw_args = PyDict_Size(__pyx_kwds);
13324 switch (pos_args) {
13326 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
13327 else goto __pyx_L5_argtuple_error;
13329 if (unlikely(kw_args > 0)) {
13330 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
13332 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
13333 goto __pyx_L5_argtuple_error;
13335 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13337 __pyx_v_name = values[0];
13339 goto __pyx_L4_argument_unpacking_done;
13340 __pyx_L5_argtuple_error:;
13341 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
13343 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13344 __Pyx_RefNannyFinishContext();
13346 __pyx_L4_argument_unpacking_done:;
13347 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
13350 __Pyx_RefNannyFinishContext();
13354 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
13356 __Pyx_TraceDeclarations
13357 __Pyx_RefNannyDeclarations
13358 int __pyx_lineno = 0;
13359 const char *__pyx_filename = NULL;
13360 int __pyx_clineno = 0;
13361 __Pyx_RefNannySetupContext(
"__init__", 0);
13362 __Pyx_TraceCall(
"__init__", __pyx_f[1], 281, 0, __PYX_ERR(1, 281, __pyx_L1_error));
13371 __Pyx_TraceLine(282,0,__PYX_ERR(1, 282, __pyx_L1_error))
13372 __Pyx_INCREF(__pyx_v_name);
13373 __Pyx_GIVEREF(__pyx_v_name);
13374 __Pyx_GOTREF(__pyx_v_self->name);
13375 __Pyx_DECREF(__pyx_v_self->name);
13376 __pyx_v_self->name = __pyx_v_name;
13390 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13393 __Pyx_TraceReturn(Py_None, 0);
13394 __Pyx_RefNannyFinishContext();
13407 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
13408 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
13409 PyObject *__pyx_r = 0;
13410 __Pyx_RefNannyDeclarations
13411 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
13412 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
13415 __Pyx_RefNannyFinishContext();
13419 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
13420 PyObject *__pyx_r = NULL;
13421 __Pyx_TraceDeclarations
13422 __Pyx_RefNannyDeclarations
13423 int __pyx_lineno = 0;
13424 const char *__pyx_filename = NULL;
13425 int __pyx_clineno = 0;
13426 __Pyx_RefNannySetupContext(
"__repr__", 0);
13427 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 283, 0, __PYX_ERR(1, 283, __pyx_L1_error));
13436 __Pyx_TraceLine(284,0,__PYX_ERR(1, 284, __pyx_L1_error))
13437 __Pyx_XDECREF(__pyx_r);
13438 __Pyx_INCREF(__pyx_v_self->name);
13439 __pyx_r = __pyx_v_self->name;
13452 __Pyx_AddTraceback(
"View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13455 __Pyx_XGIVEREF(__pyx_r);
13456 __Pyx_TraceReturn(__pyx_r, 0);
13457 __Pyx_RefNannyFinishContext();
13468 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13469 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
13470 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13471 PyObject *__pyx_r = 0;
13472 __Pyx_RefNannyDeclarations
13473 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
13474 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
13477 __Pyx_RefNannyFinishContext();
13481 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
13482 PyObject *__pyx_v_state = 0;
13483 PyObject *__pyx_v__dict = 0;
13484 int __pyx_v_use_setstate;
13485 PyObject *__pyx_r = NULL;
13486 __Pyx_TraceDeclarations
13487 __Pyx_RefNannyDeclarations
13488 PyObject *__pyx_t_1 = NULL;
13491 PyObject *__pyx_t_4 = NULL;
13492 PyObject *__pyx_t_5 = NULL;
13493 int __pyx_lineno = 0;
13494 const char *__pyx_filename = NULL;
13495 int __pyx_clineno = 0;
13496 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
13497 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13506 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
13507 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
13508 __Pyx_GOTREF(__pyx_t_1);
13509 __Pyx_INCREF(__pyx_v_self->name);
13510 __Pyx_GIVEREF(__pyx_v_self->name);
13511 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
13512 __pyx_v_state = ((PyObject*)__pyx_t_1);
13522 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
13523 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
13524 __Pyx_GOTREF(__pyx_t_1);
13525 __pyx_v__dict = __pyx_t_1;
13535 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
13536 __pyx_t_2 = (__pyx_v__dict != Py_None);
13537 __pyx_t_3 = (__pyx_t_2 != 0);
13547 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
13548 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
13549 __Pyx_GOTREF(__pyx_t_1);
13550 __Pyx_INCREF(__pyx_v__dict);
13551 __Pyx_GIVEREF(__pyx_v__dict);
13552 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
13553 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
13554 __Pyx_GOTREF(__pyx_t_4);
13555 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13556 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
13566 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
13567 __pyx_v_use_setstate = 1;
13586 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
13588 __pyx_t_3 = (__pyx_v_self->name != Py_None);
13589 __pyx_v_use_setstate = __pyx_t_3;
13600 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
13601 __pyx_t_3 = (__pyx_v_use_setstate != 0);
13611 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
13612 __Pyx_XDECREF(__pyx_r);
13613 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
13614 __Pyx_GOTREF(__pyx_t_4);
13615 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
13616 __Pyx_GOTREF(__pyx_t_1);
13617 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13618 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13619 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13620 __Pyx_INCREF(__pyx_int_184977713);
13621 __Pyx_GIVEREF(__pyx_int_184977713);
13622 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
13623 __Pyx_INCREF(Py_None);
13624 __Pyx_GIVEREF(Py_None);
13625 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
13626 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
13627 __Pyx_GOTREF(__pyx_t_5);
13628 __Pyx_GIVEREF(__pyx_t_4);
13629 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13630 __Pyx_GIVEREF(__pyx_t_1);
13631 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
13632 __Pyx_INCREF(__pyx_v_state);
13633 __Pyx_GIVEREF(__pyx_v_state);
13634 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
13637 __pyx_r = __pyx_t_5;
13657 __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
13659 __Pyx_XDECREF(__pyx_r);
13660 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
13661 __Pyx_GOTREF(__pyx_t_5);
13662 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
13663 __Pyx_GOTREF(__pyx_t_1);
13664 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13665 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13666 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13667 __Pyx_INCREF(__pyx_int_184977713);
13668 __Pyx_GIVEREF(__pyx_int_184977713);
13669 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
13670 __Pyx_INCREF(__pyx_v_state);
13671 __Pyx_GIVEREF(__pyx_v_state);
13672 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
13673 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
13674 __Pyx_GOTREF(__pyx_t_4);
13675 __Pyx_GIVEREF(__pyx_t_5);
13676 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
13677 __Pyx_GIVEREF(__pyx_t_1);
13678 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
13681 __pyx_r = __pyx_t_4;
13694 __Pyx_XDECREF(__pyx_t_1);
13695 __Pyx_XDECREF(__pyx_t_4);
13696 __Pyx_XDECREF(__pyx_t_5);
13697 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13700 __Pyx_XDECREF(__pyx_v_state);
13701 __Pyx_XDECREF(__pyx_v__dict);
13702 __Pyx_XGIVEREF(__pyx_r);
13703 __Pyx_TraceReturn(__pyx_r, 0);
13704 __Pyx_RefNannyFinishContext();
13716 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
13717 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
13718 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13719 PyObject *__pyx_r = 0;
13720 __Pyx_RefNannyDeclarations
13721 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
13722 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13725 __Pyx_RefNannyFinishContext();
13729 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13730 PyObject *__pyx_r = NULL;
13731 __Pyx_TraceDeclarations
13732 __Pyx_RefNannyDeclarations
13733 PyObject *__pyx_t_1 = NULL;
13734 int __pyx_lineno = 0;
13735 const char *__pyx_filename = NULL;
13736 int __pyx_clineno = 0;
13737 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
13738 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
13745 __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
13746 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
13747 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
13748 __Pyx_GOTREF(__pyx_t_1);
13749 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13759 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13762 __Pyx_XDECREF(__pyx_t_1);
13763 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13766 __Pyx_XGIVEREF(__pyx_r);
13767 __Pyx_TraceReturn(__pyx_r, 0);
13768 __Pyx_RefNannyFinishContext();
13780 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
13781 Py_intptr_t __pyx_v_aligned_p;
13782 size_t __pyx_v_offset;
13784 __Pyx_TraceDeclarations
13786 int __pyx_lineno = 0;
13787 const char *__pyx_filename = NULL;
13788 int __pyx_clineno = 0;
13789 __Pyx_TraceCall(
"align_pointer", __pyx_f[1], 298, 1, __PYX_ERR(1, 298, __pyx_L1_error));
13798 __Pyx_TraceLine(300,1,__PYX_ERR(1, 300, __pyx_L1_error))
13799 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
13808 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
13817 __Pyx_TraceLine(306,1,__PYX_ERR(1, 306, __pyx_L1_error))
13818 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
13828 __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
13829 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
13847 __Pyx_TraceLine(309,1,__PYX_ERR(1, 309, __pyx_L1_error))
13848 __pyx_r = ((
void *)__pyx_v_aligned_p);
13861 __Pyx_WriteUnraisable(
"View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
13864 __Pyx_TraceReturn(Py_None, 1);
13877 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13878 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13879 PyObject *__pyx_v_obj = 0;
13881 int __pyx_v_dtype_is_object;
13882 int __pyx_lineno = 0;
13883 const char *__pyx_filename = NULL;
13884 int __pyx_clineno = 0;
13886 __Pyx_RefNannyDeclarations
13887 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
13889 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
13890 PyObject* values[3] = {0,0,0};
13891 if (unlikely(__pyx_kwds)) {
13892 Py_ssize_t kw_args;
13893 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13894 switch (pos_args) {
13895 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13896 CYTHON_FALLTHROUGH;
13897 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13898 CYTHON_FALLTHROUGH;
13899 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13900 CYTHON_FALLTHROUGH;
13902 default:
goto __pyx_L5_argtuple_error;
13904 kw_args = PyDict_Size(__pyx_kwds);
13905 switch (pos_args) {
13907 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13908 else goto __pyx_L5_argtuple_error;
13909 CYTHON_FALLTHROUGH;
13911 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
13913 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
13915 CYTHON_FALLTHROUGH;
13918 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
13919 if (value) { values[2] = value; kw_args--; }
13922 if (unlikely(kw_args > 0)) {
13923 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
13926 switch (PyTuple_GET_SIZE(__pyx_args)) {
13927 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13928 CYTHON_FALLTHROUGH;
13929 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13930 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13932 default:
goto __pyx_L5_argtuple_error;
13935 __pyx_v_obj = values[0];
13936 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
13938 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
13940 __pyx_v_dtype_is_object = ((int)0);
13943 goto __pyx_L4_argument_unpacking_done;
13944 __pyx_L5_argtuple_error:;
13945 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
13947 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13948 __Pyx_RefNannyFinishContext();
13950 __pyx_L4_argument_unpacking_done:;
13951 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
13954 __Pyx_RefNannyFinishContext();
13958 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
13960 __Pyx_TraceDeclarations
13961 __Pyx_RefNannyDeclarations
13966 int __pyx_lineno = 0;
13967 const char *__pyx_filename = NULL;
13968 int __pyx_clineno = 0;
13969 __Pyx_RefNannySetupContext(
"__cinit__", 0);
13970 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 345, 0, __PYX_ERR(1, 345, __pyx_L1_error));
13979 __Pyx_TraceLine(346,0,__PYX_ERR(1, 346, __pyx_L1_error))
13980 __Pyx_INCREF(__pyx_v_obj);
13981 __Pyx_GIVEREF(__pyx_v_obj);
13982 __Pyx_GOTREF(__pyx_v_self->obj);
13983 __Pyx_DECREF(__pyx_v_self->obj);
13984 __pyx_v_self->obj = __pyx_v_obj;
13993 __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
13994 __pyx_v_self->flags = __pyx_v_flags;
14003 __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
14004 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
14005 __pyx_t_3 = (__pyx_t_2 != 0);
14008 __pyx_t_1 = __pyx_t_3;
14009 goto __pyx_L4_bool_binop_done;
14011 __pyx_t_3 = (__pyx_v_obj != Py_None);
14012 __pyx_t_2 = (__pyx_t_3 != 0);
14013 __pyx_t_1 = __pyx_t_2;
14014 __pyx_L4_bool_binop_done:;
14024 __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
14025 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
14034 __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
14035 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
14045 __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
14046 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
14055 __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
14056 Py_INCREF(Py_None);
14083 __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
14084 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
14094 __Pyx_TraceLine(356,0,__PYX_ERR(1, 356, __pyx_L1_error))
14095 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
14104 __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
14105 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
14123 __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
14124 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
14134 __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
14135 __pyx_v_self->lock = PyThread_allocate_lock();
14144 __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
14145 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
14146 if (unlikely(__pyx_t_1)) {
14155 __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
14156 PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
14183 __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
14184 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
14194 __Pyx_TraceLine(364,0,__PYX_ERR(1, 364, __pyx_L1_error))
14195 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
14198 __pyx_t_1 = __pyx_t_2;
14199 goto __pyx_L11_bool_binop_done;
14201 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
14202 __pyx_t_1 = __pyx_t_2;
14203 __pyx_L11_bool_binop_done:;
14204 __pyx_v_self->dtype_is_object = __pyx_t_1;
14223 __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
14225 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
14236 __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
14237 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
14246 __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
14247 __pyx_v_self->typeinfo = NULL;
14261 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14264 __Pyx_TraceReturn(Py_None, 0);
14265 __Pyx_RefNannyFinishContext();
14278 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
14279 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
14280 __Pyx_RefNannyDeclarations
14281 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
14282 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14285 __Pyx_RefNannyFinishContext();
14288 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14290 __Pyx_TraceDeclarations
14291 __Pyx_RefNannyDeclarations
14297 PyThread_type_lock __pyx_t_6;
14298 PyThread_type_lock __pyx_t_7;
14299 int __pyx_lineno = 0;
14300 const char *__pyx_filename = NULL;
14301 int __pyx_clineno = 0;
14302 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
14303 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 372, 0, __PYX_ERR(1, 372, __pyx_L1_error));
14312 __Pyx_TraceLine(373,0,__PYX_ERR(1, 373, __pyx_L1_error))
14313 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
14314 __pyx_t_2 = (__pyx_t_1 != 0);
14324 __Pyx_TraceLine(374,0,__PYX_ERR(1, 374, __pyx_L1_error))
14325 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
14344 __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
14345 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
14355 __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
14356 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
14365 __Pyx_TraceLine(378,0,__PYX_ERR(1, 378, __pyx_L1_error))
14366 Py_DECREF(Py_None);
14385 __Pyx_TraceLine(382,0,__PYX_ERR(1, 382, __pyx_L1_error))
14386 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
14396 __Pyx_TraceLine(383,0,__PYX_ERR(1, 383, __pyx_L1_error))
14397 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
14398 __pyx_t_4 = __pyx_t_3;
14399 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
14400 __pyx_v_i = __pyx_t_5;
14409 __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
14410 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
14420 __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
14421 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
14430 __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
14431 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
14441 __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
14442 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
14443 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
14452 __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
14453 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
14454 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
14472 __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
14473 goto __pyx_L6_break;
14493 __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
14494 PyThread_free_lock(__pyx_v_self->lock);
14518 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
14520 __Pyx_TraceReturn(Py_None, 0);
14521 __Pyx_RefNannyFinishContext();
14532 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
14533 Py_ssize_t __pyx_v_dim;
14534 char *__pyx_v_itemp;
14535 PyObject *__pyx_v_idx = NULL;
14537 __Pyx_TraceDeclarations
14538 __Pyx_RefNannyDeclarations
14539 Py_ssize_t __pyx_t_1;
14540 PyObject *__pyx_t_2 = NULL;
14541 Py_ssize_t __pyx_t_3;
14542 PyObject *(*__pyx_t_4)(PyObject *);
14543 PyObject *__pyx_t_5 = NULL;
14544 Py_ssize_t __pyx_t_6;
14546 int __pyx_lineno = 0;
14547 const char *__pyx_filename = NULL;
14548 int __pyx_clineno = 0;
14549 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
14550 __Pyx_TraceCall(
"get_item_pointer", __pyx_f[1], 393, 0, __PYX_ERR(1, 393, __pyx_L1_error));
14559 __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
14560 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
14569 __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
14571 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
14572 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
14575 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
14576 __Pyx_GOTREF(__pyx_t_2);
14577 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
14580 if (likely(!__pyx_t_4)) {
14581 if (likely(PyList_CheckExact(__pyx_t_2))) {
14582 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
14583 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14584 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
14586 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
14587 __Pyx_GOTREF(__pyx_t_5);
14590 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
14591 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14592 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
14594 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
14595 __Pyx_GOTREF(__pyx_t_5);
14599 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
14600 if (unlikely(!__pyx_t_5)) {
14601 PyObject* exc_type = PyErr_Occurred();
14603 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14604 else __PYX_ERR(1, 397, __pyx_L1_error)
14608 __Pyx_GOTREF(__pyx_t_5);
14610 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
14612 __pyx_v_dim = __pyx_t_1;
14613 __pyx_t_1 = (__pyx_t_1 + 1);
14622 __Pyx_TraceLine(398,0,__PYX_ERR(1, 398, __pyx_L1_error))
14623 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
14624 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
14625 __pyx_v_itemp = __pyx_t_7;
14634 __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
14636 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14645 __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
14646 __pyx_r = __pyx_v_itemp;
14659 __Pyx_XDECREF(__pyx_t_2);
14660 __Pyx_XDECREF(__pyx_t_5);
14661 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
14664 __Pyx_XDECREF(__pyx_v_idx);
14665 __Pyx_TraceReturn(Py_None, 0);
14666 __Pyx_RefNannyFinishContext();
14679 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
14680 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
14681 PyObject *__pyx_r = 0;
14682 __Pyx_RefNannyDeclarations
14683 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
14684 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
14687 __Pyx_RefNannyFinishContext();
14691 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
14692 PyObject *__pyx_v_have_slices = NULL;
14693 PyObject *__pyx_v_indices = NULL;
14694 char *__pyx_v_itemp;
14695 PyObject *__pyx_r = NULL;
14696 __Pyx_TraceDeclarations
14697 __Pyx_RefNannyDeclarations
14700 PyObject *__pyx_t_3 = NULL;
14701 PyObject *__pyx_t_4 = NULL;
14702 PyObject *__pyx_t_5 = NULL;
14704 int __pyx_lineno = 0;
14705 const char *__pyx_filename = NULL;
14706 int __pyx_clineno = 0;
14707 __Pyx_RefNannySetupContext(
"__getitem__", 0);
14708 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 403, 0, __PYX_ERR(1, 403, __pyx_L1_error));
14717 __Pyx_TraceLine(404,0,__PYX_ERR(1, 404, __pyx_L1_error))
14718 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
14719 __pyx_t_2 = (__pyx_t_1 != 0);
14729 __Pyx_TraceLine(405,0,__PYX_ERR(1, 405, __pyx_L1_error))
14730 __Pyx_XDECREF(__pyx_r);
14731 __Pyx_INCREF(((PyObject *)__pyx_v_self));
14732 __pyx_r = ((PyObject *)__pyx_v_self);
14751 __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
14752 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
14753 __Pyx_GOTREF(__pyx_t_3);
14754 if (likely(__pyx_t_3 != Py_None)) {
14755 PyObject* sequence = __pyx_t_3;
14756 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
14757 if (unlikely(size != 2)) {
14758 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
14759 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
14760 __PYX_ERR(1, 407, __pyx_L1_error)
14762 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14763 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
14764 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
14765 __Pyx_INCREF(__pyx_t_4);
14766 __Pyx_INCREF(__pyx_t_5);
14768 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
14769 __Pyx_GOTREF(__pyx_t_4);
14770 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
14771 __Pyx_GOTREF(__pyx_t_5);
14773 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14775 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
14777 __pyx_v_have_slices = __pyx_t_4;
14779 __pyx_v_indices = __pyx_t_5;
14789 __Pyx_TraceLine(410,0,__PYX_ERR(1, 410, __pyx_L1_error))
14790 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
14800 __Pyx_TraceLine(411,0,__PYX_ERR(1, 411, __pyx_L1_error))
14801 __Pyx_XDECREF(__pyx_r);
14802 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
14803 __Pyx_GOTREF(__pyx_t_3);
14804 __pyx_r = __pyx_t_3;
14824 __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
14826 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
14827 __pyx_v_itemp = __pyx_t_6;
14836 __Pyx_TraceLine(414,0,__PYX_ERR(1, 414, __pyx_L1_error))
14837 __Pyx_XDECREF(__pyx_r);
14838 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
14839 __Pyx_GOTREF(__pyx_t_3);
14840 __pyx_r = __pyx_t_3;
14855 __Pyx_XDECREF(__pyx_t_3);
14856 __Pyx_XDECREF(__pyx_t_4);
14857 __Pyx_XDECREF(__pyx_t_5);
14858 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14861 __Pyx_XDECREF(__pyx_v_have_slices);
14862 __Pyx_XDECREF(__pyx_v_indices);
14863 __Pyx_XGIVEREF(__pyx_r);
14864 __Pyx_TraceReturn(__pyx_r, 0);
14865 __Pyx_RefNannyFinishContext();
14878 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
14879 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
14881 __Pyx_RefNannyDeclarations
14882 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
14883 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
14886 __Pyx_RefNannyFinishContext();
14890 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
14891 PyObject *__pyx_v_have_slices = NULL;
14892 PyObject *__pyx_v_obj = NULL;
14894 __Pyx_TraceDeclarations
14895 __Pyx_RefNannyDeclarations
14897 PyObject *__pyx_t_2 = NULL;
14898 PyObject *__pyx_t_3 = NULL;
14899 PyObject *__pyx_t_4 = NULL;
14900 int __pyx_lineno = 0;
14901 const char *__pyx_filename = NULL;
14902 int __pyx_clineno = 0;
14903 __Pyx_RefNannySetupContext(
"__setitem__", 0);
14904 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 416, 0, __PYX_ERR(1, 416, __pyx_L1_error));
14905 __Pyx_INCREF(__pyx_v_index);
14914 __Pyx_TraceLine(417,0,__PYX_ERR(1, 417, __pyx_L1_error))
14915 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
14916 if (unlikely(__pyx_t_1)) {
14925 __Pyx_TraceLine(418,0,__PYX_ERR(1, 418, __pyx_L1_error))
14926 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
14927 __Pyx_GOTREF(__pyx_t_2);
14928 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
14929 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14930 __PYX_ERR(1, 418, __pyx_L1_error)
14948 __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
14949 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
14950 __Pyx_GOTREF(__pyx_t_2);
14951 if (likely(__pyx_t_2 != Py_None)) {
14952 PyObject* sequence = __pyx_t_2;
14953 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
14954 if (unlikely(size != 2)) {
14955 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
14956 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
14957 __PYX_ERR(1, 420, __pyx_L1_error)
14959 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14960 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
14961 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
14962 __Pyx_INCREF(__pyx_t_3);
14963 __Pyx_INCREF(__pyx_t_4);
14965 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
14966 __Pyx_GOTREF(__pyx_t_3);
14967 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
14968 __Pyx_GOTREF(__pyx_t_4);
14970 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14972 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
14974 __pyx_v_have_slices = __pyx_t_3;
14976 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
14986 __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
14987 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
14997 __Pyx_TraceLine(423,0,__PYX_ERR(1, 423, __pyx_L1_error))
14998 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
14999 __Pyx_GOTREF(__pyx_t_2);
15000 __pyx_v_obj = __pyx_t_2;
15010 __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
15011 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
15021 __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
15022 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
15023 __Pyx_GOTREF(__pyx_t_2);
15024 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
15025 __Pyx_GOTREF(__pyx_t_4);
15026 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15027 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15046 __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
15048 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
15049 __Pyx_GOTREF(__pyx_t_4);
15050 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
15051 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
15052 __Pyx_GOTREF(__pyx_t_2);
15053 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15054 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15075 __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
15077 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
15078 __Pyx_GOTREF(__pyx_t_2);
15079 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15095 __Pyx_XDECREF(__pyx_t_2);
15096 __Pyx_XDECREF(__pyx_t_3);
15097 __Pyx_XDECREF(__pyx_t_4);
15098 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15101 __Pyx_XDECREF(__pyx_v_have_slices);
15102 __Pyx_XDECREF(__pyx_v_obj);
15103 __Pyx_XDECREF(__pyx_v_index);
15104 __Pyx_TraceReturn(Py_None, 0);
15105 __Pyx_RefNannyFinishContext();
15117 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
15118 PyObject *__pyx_r = NULL;
15119 __Pyx_TraceDeclarations
15120 __Pyx_RefNannyDeclarations
15123 PyObject *__pyx_t_3 = NULL;
15124 PyObject *__pyx_t_4 = NULL;
15125 PyObject *__pyx_t_5 = NULL;
15126 PyObject *__pyx_t_6 = NULL;
15127 PyObject *__pyx_t_7 = NULL;
15128 PyObject *__pyx_t_8 = NULL;
15130 int __pyx_lineno = 0;
15131 const char *__pyx_filename = NULL;
15132 int __pyx_clineno = 0;
15133 __Pyx_RefNannySetupContext(
"is_slice", 0);
15134 __Pyx_TraceCall(
"is_slice", __pyx_f[1], 431, 0, __PYX_ERR(1, 431, __pyx_L1_error));
15135 __Pyx_INCREF(__pyx_v_obj);
15144 __Pyx_TraceLine(432,0,__PYX_ERR(1, 432, __pyx_L1_error))
15145 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
15146 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15156 __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
15158 __Pyx_PyThreadState_declare
15159 __Pyx_PyThreadState_assign
15160 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
15161 __Pyx_XGOTREF(__pyx_t_3);
15162 __Pyx_XGOTREF(__pyx_t_4);
15163 __Pyx_XGOTREF(__pyx_t_5);
15173 __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L4_error))
15174 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
15175 __Pyx_GOTREF(__pyx_t_6);
15184 __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L4_error))
15185 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
15186 __Pyx_GOTREF(__pyx_t_7);
15195 __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L4_error))
15196 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
15197 __Pyx_GOTREF(__pyx_t_8);
15198 __Pyx_INCREF(__pyx_v_obj);
15199 __Pyx_GIVEREF(__pyx_v_obj);
15200 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
15201 __Pyx_GIVEREF(__pyx_t_6);
15202 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
15203 __Pyx_GIVEREF(__pyx_t_7);
15204 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
15207 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
15208 __Pyx_GOTREF(__pyx_t_7);
15209 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15210 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
15221 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15222 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15223 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15224 goto __pyx_L9_try_end;
15226 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15227 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15228 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15237 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L6_except_error))
15238 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
15240 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15241 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
15242 __Pyx_GOTREF(__pyx_t_7);
15243 __Pyx_GOTREF(__pyx_t_8);
15244 __Pyx_GOTREF(__pyx_t_6);
15253 __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L6_except_error))
15254 __Pyx_XDECREF(__pyx_r);
15255 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15256 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15257 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15258 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15259 goto __pyx_L7_except_return;
15261 goto __pyx_L6_except_error;
15262 __pyx_L6_except_error:;
15271 __Pyx_XGIVEREF(__pyx_t_3);
15272 __Pyx_XGIVEREF(__pyx_t_4);
15273 __Pyx_XGIVEREF(__pyx_t_5);
15274 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15275 goto __pyx_L1_error;
15276 __pyx_L7_except_return:;
15277 __Pyx_XGIVEREF(__pyx_t_3);
15278 __Pyx_XGIVEREF(__pyx_t_4);
15279 __Pyx_XGIVEREF(__pyx_t_5);
15280 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15301 __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L1_error))
15302 __Pyx_XDECREF(__pyx_r);
15303 __Pyx_INCREF(__pyx_v_obj);
15304 __pyx_r = __pyx_v_obj;
15317 __Pyx_XDECREF(__pyx_t_6);
15318 __Pyx_XDECREF(__pyx_t_7);
15319 __Pyx_XDECREF(__pyx_t_8);
15320 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15323 __Pyx_XDECREF(__pyx_v_obj);
15324 __Pyx_XGIVEREF(__pyx_r);
15325 __Pyx_TraceReturn(__pyx_r, 0);
15326 __Pyx_RefNannyFinishContext();
15338 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
15339 __Pyx_memviewslice __pyx_v_dst_slice;
15340 __Pyx_memviewslice __pyx_v_src_slice;
15341 PyObject *__pyx_r = NULL;
15342 __Pyx_TraceDeclarations
15343 __Pyx_RefNannyDeclarations
15344 __Pyx_memviewslice *__pyx_t_1;
15345 __Pyx_memviewslice *__pyx_t_2;
15346 PyObject *__pyx_t_3 = NULL;
15350 int __pyx_lineno = 0;
15351 const char *__pyx_filename = NULL;
15352 int __pyx_clineno = 0;
15353 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
15354 __Pyx_TraceCall(
"setitem_slice_assignment", __pyx_f[1], 441, 0, __PYX_ERR(1, 441, __pyx_L1_error));
15363 __Pyx_TraceLine(445,0,__PYX_ERR(1, 445, __pyx_L1_error))
15364 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
15365 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
15374 __Pyx_TraceLine(446,0,__PYX_ERR(1, 446, __pyx_L1_error))
15375 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
15376 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
15385 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
15386 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
15387 __Pyx_GOTREF(__pyx_t_3);
15388 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
15389 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15390 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
15391 __Pyx_GOTREF(__pyx_t_3);
15392 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
15393 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15402 __Pyx_TraceLine(445,0,__PYX_ERR(1, 445, __pyx_L1_error))
15403 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
15414 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15417 __Pyx_XDECREF(__pyx_t_3);
15418 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
15421 __Pyx_XGIVEREF(__pyx_r);
15422 __Pyx_TraceReturn(__pyx_r, 0);
15423 __Pyx_RefNannyFinishContext();
15435 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
15436 int __pyx_v_array[0x80];
15438 void *__pyx_v_item;
15439 __Pyx_memviewslice *__pyx_v_dst_slice;
15440 __Pyx_memviewslice __pyx_v_tmp_slice;
15441 PyObject *__pyx_r = NULL;
15442 __Pyx_TraceDeclarations
15443 __Pyx_RefNannyDeclarations
15444 __Pyx_memviewslice *__pyx_t_1;
15446 PyObject *__pyx_t_3 = NULL;
15449 char const *__pyx_t_6;
15450 PyObject *__pyx_t_7 = NULL;
15451 PyObject *__pyx_t_8 = NULL;
15452 PyObject *__pyx_t_9 = NULL;
15453 PyObject *__pyx_t_10 = NULL;
15454 PyObject *__pyx_t_11 = NULL;
15455 PyObject *__pyx_t_12 = NULL;
15456 int __pyx_lineno = 0;
15457 const char *__pyx_filename = NULL;
15458 int __pyx_clineno = 0;
15459 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
15460 __Pyx_TraceCall(
"setitem_slice_assign_scalar", __pyx_f[1], 449, 0, __PYX_ERR(1, 449, __pyx_L1_error));
15469 __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
15470 __pyx_v_tmp = NULL;
15479 __Pyx_TraceLine(456,0,__PYX_ERR(1, 456, __pyx_L1_error))
15480 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
15481 __pyx_v_dst_slice = __pyx_t_1;
15490 __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
15491 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
15501 __Pyx_TraceLine(459,0,__PYX_ERR(1, 459, __pyx_L1_error))
15502 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
15511 __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
15512 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
15513 if (unlikely(__pyx_t_2)) {
15522 __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
15523 PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
15541 __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
15542 __pyx_v_item = __pyx_v_tmp;
15561 __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
15563 __pyx_v_item = ((
void *)__pyx_v_array);
15574 __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
15584 __Pyx_TraceLine(467,0,__PYX_ERR(1, 467, __pyx_L6_error))
15585 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
15595 __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L6_error))
15596 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
15615 __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
15617 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
15618 __Pyx_GOTREF(__pyx_t_3);
15619 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15630 __Pyx_TraceLine(474,0,__PYX_ERR(1, 474, __pyx_L6_error))
15631 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
15641 __Pyx_TraceLine(475,0,__PYX_ERR(1, 475, __pyx_L6_error))
15642 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
15643 __Pyx_GOTREF(__pyx_t_3);
15644 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15662 __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
15663 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
15673 __Pyx_TraceLine(479,0,__PYX_ERR(1, 479, __pyx_L6_error))
15676 PyMem_Free(__pyx_v_tmp);
15681 __Pyx_PyThreadState_declare
15682 __Pyx_PyThreadState_assign
15683 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
15684 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15685 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
15686 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
15687 __Pyx_XGOTREF(__pyx_t_7);
15688 __Pyx_XGOTREF(__pyx_t_8);
15689 __Pyx_XGOTREF(__pyx_t_9);
15690 __Pyx_XGOTREF(__pyx_t_10);
15691 __Pyx_XGOTREF(__pyx_t_11);
15692 __Pyx_XGOTREF(__pyx_t_12);
15693 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
15695 PyMem_Free(__pyx_v_tmp);
15697 if (PY_MAJOR_VERSION >= 3) {
15698 __Pyx_XGIVEREF(__pyx_t_10);
15699 __Pyx_XGIVEREF(__pyx_t_11);
15700 __Pyx_XGIVEREF(__pyx_t_12);
15701 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
15703 __Pyx_XGIVEREF(__pyx_t_7);
15704 __Pyx_XGIVEREF(__pyx_t_8);
15705 __Pyx_XGIVEREF(__pyx_t_9);
15706 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
15707 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
15708 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
15709 goto __pyx_L1_error;
15723 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15726 __Pyx_XDECREF(__pyx_t_3);
15727 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
15730 __Pyx_XGIVEREF(__pyx_r);
15731 __Pyx_TraceReturn(__pyx_r, 0);
15732 __Pyx_RefNannyFinishContext();
15744 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
15745 char *__pyx_v_itemp;
15746 PyObject *__pyx_r = NULL;
15747 __Pyx_TraceDeclarations
15748 __Pyx_RefNannyDeclarations
15750 PyObject *__pyx_t_2 = NULL;
15751 int __pyx_lineno = 0;
15752 const char *__pyx_filename = NULL;
15753 int __pyx_clineno = 0;
15754 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
15755 __Pyx_TraceCall(
"setitem_indexed", __pyx_f[1], 481, 0, __PYX_ERR(1, 481, __pyx_L1_error));
15764 __Pyx_TraceLine(482,0,__PYX_ERR(1, 482, __pyx_L1_error))
15765 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
15766 __pyx_v_itemp = __pyx_t_1;
15775 __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
15776 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
15777 __Pyx_GOTREF(__pyx_t_2);
15778 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15789 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15792 __Pyx_XDECREF(__pyx_t_2);
15793 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
15796 __Pyx_XGIVEREF(__pyx_r);
15797 __Pyx_TraceReturn(__pyx_r, 0);
15798 __Pyx_RefNannyFinishContext();
15810 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
15811 PyObject *__pyx_v_struct = NULL;
15812 PyObject *__pyx_v_bytesitem = 0;
15813 PyObject *__pyx_v_result = NULL;
15814 PyObject *__pyx_r = NULL;
15815 __Pyx_TraceDeclarations
15816 __Pyx_RefNannyDeclarations
15817 PyObject *__pyx_t_1 = NULL;
15818 PyObject *__pyx_t_2 = NULL;
15819 PyObject *__pyx_t_3 = NULL;
15820 PyObject *__pyx_t_4 = NULL;
15821 PyObject *__pyx_t_5 = NULL;
15822 PyObject *__pyx_t_6 = NULL;
15823 PyObject *__pyx_t_7 = NULL;
15825 PyObject *__pyx_t_9 = NULL;
15828 int __pyx_lineno = 0;
15829 const char *__pyx_filename = NULL;
15830 int __pyx_clineno = 0;
15831 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
15832 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 485, 0, __PYX_ERR(1, 485, __pyx_L1_error));
15841 __Pyx_TraceLine(488,0,__PYX_ERR(1, 488, __pyx_L1_error))
15842 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
15843 __Pyx_GOTREF(__pyx_t_1);
15844 __pyx_v_struct = __pyx_t_1;
15854 __Pyx_TraceLine(491,0,__PYX_ERR(1, 491, __pyx_L1_error))
15855 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
15856 __Pyx_GOTREF(__pyx_t_1);
15857 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
15867 __Pyx_TraceLine(492,0,__PYX_ERR(1, 492, __pyx_L1_error))
15869 __Pyx_PyThreadState_declare
15870 __Pyx_PyThreadState_assign
15871 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
15872 __Pyx_XGOTREF(__pyx_t_2);
15873 __Pyx_XGOTREF(__pyx_t_3);
15874 __Pyx_XGOTREF(__pyx_t_4);
15884 __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L3_error))
15885 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
15886 __Pyx_GOTREF(__pyx_t_5);
15887 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
15888 __Pyx_GOTREF(__pyx_t_6);
15891 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
15892 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
15893 if (likely(__pyx_t_7)) {
15894 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
15895 __Pyx_INCREF(__pyx_t_7);
15896 __Pyx_INCREF(
function);
15897 __Pyx_DECREF_SET(__pyx_t_5,
function);
15901 #if CYTHON_FAST_PYCALL
15902 if (PyFunction_Check(__pyx_t_5)) {
15903 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
15904 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
15905 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15906 __Pyx_GOTREF(__pyx_t_1);
15907 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15910 #if CYTHON_FAST_PYCCALL
15911 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
15912 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
15913 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
15914 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15915 __Pyx_GOTREF(__pyx_t_1);
15916 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15920 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
15921 __Pyx_GOTREF(__pyx_t_9);
15923 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
15925 __Pyx_GIVEREF(__pyx_t_6);
15926 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
15927 __Pyx_INCREF(__pyx_v_bytesitem);
15928 __Pyx_GIVEREF(__pyx_v_bytesitem);
15929 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
15931 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
15932 __Pyx_GOTREF(__pyx_t_1);
15933 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15935 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15936 __pyx_v_result = __pyx_t_1;
15955 __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
15957 __pyx_t_10 = strlen(__pyx_v_self->view.format);
15958 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
15968 __Pyx_TraceLine(498,0,__PYX_ERR(1, 498, __pyx_L5_except_error))
15969 __Pyx_XDECREF(__pyx_r);
15970 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
15971 __Pyx_GOTREF(__pyx_t_1);
15972 __pyx_r = __pyx_t_1;
15974 goto __pyx_L6_except_return;
15992 __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
15993 __Pyx_XDECREF(__pyx_r);
15994 __Pyx_INCREF(__pyx_v_result);
15995 __pyx_r = __pyx_v_result;
15996 goto __pyx_L6_except_return;
15999 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16000 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16001 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16002 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16003 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16012 __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L5_except_error))
16013 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
16014 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
16015 __Pyx_GOTREF(__pyx_t_6);
16016 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
16017 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16018 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
16019 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
16021 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16022 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
16023 __Pyx_GOTREF(__pyx_t_9);
16024 __Pyx_GOTREF(__pyx_t_5);
16025 __Pyx_GOTREF(__pyx_t_1);
16034 __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L5_except_error))
16035 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
16036 __Pyx_GOTREF(__pyx_t_6);
16037 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
16038 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16039 __PYX_ERR(1, 495, __pyx_L5_except_error)
16041 goto __pyx_L5_except_error;
16042 __pyx_L5_except_error:;
16051 __Pyx_XGIVEREF(__pyx_t_2);
16052 __Pyx_XGIVEREF(__pyx_t_3);
16053 __Pyx_XGIVEREF(__pyx_t_4);
16054 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
16055 goto __pyx_L1_error;
16056 __pyx_L6_except_return:;
16057 __Pyx_XGIVEREF(__pyx_t_2);
16058 __Pyx_XGIVEREF(__pyx_t_3);
16059 __Pyx_XGIVEREF(__pyx_t_4);
16060 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
16074 __Pyx_XDECREF(__pyx_t_1);
16075 __Pyx_XDECREF(__pyx_t_5);
16076 __Pyx_XDECREF(__pyx_t_6);
16077 __Pyx_XDECREF(__pyx_t_7);
16078 __Pyx_XDECREF(__pyx_t_9);
16079 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16082 __Pyx_XDECREF(__pyx_v_struct);
16083 __Pyx_XDECREF(__pyx_v_bytesitem);
16084 __Pyx_XDECREF(__pyx_v_result);
16085 __Pyx_XGIVEREF(__pyx_r);
16086 __Pyx_TraceReturn(__pyx_r, 0);
16087 __Pyx_RefNannyFinishContext();
16099 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16100 PyObject *__pyx_v_struct = NULL;
16102 PyObject *__pyx_v_bytesvalue = 0;
16103 Py_ssize_t __pyx_v_i;
16104 PyObject *__pyx_r = NULL;
16105 __Pyx_TraceDeclarations
16106 __Pyx_RefNannyDeclarations
16107 PyObject *__pyx_t_1 = NULL;
16110 PyObject *__pyx_t_4 = NULL;
16111 PyObject *__pyx_t_5 = NULL;
16112 PyObject *__pyx_t_6 = NULL;
16114 PyObject *__pyx_t_8 = NULL;
16115 Py_ssize_t __pyx_t_9;
16116 PyObject *__pyx_t_10 = NULL;
16121 int __pyx_lineno = 0;
16122 const char *__pyx_filename = NULL;
16123 int __pyx_clineno = 0;
16124 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
16125 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 501, 0, __PYX_ERR(1, 501, __pyx_L1_error));
16134 __Pyx_TraceLine(504,0,__PYX_ERR(1, 504, __pyx_L1_error))
16135 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
16136 __Pyx_GOTREF(__pyx_t_1);
16137 __pyx_v_struct = __pyx_t_1;
16147 __Pyx_TraceLine(509,0,__PYX_ERR(1, 509, __pyx_L1_error))
16148 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
16149 __pyx_t_3 = (__pyx_t_2 != 0);
16159 __Pyx_TraceLine(510,0,__PYX_ERR(1, 510, __pyx_L1_error))
16160 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
16161 __Pyx_GOTREF(__pyx_t_1);
16162 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
16163 __Pyx_GOTREF(__pyx_t_4);
16164 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
16165 __Pyx_GOTREF(__pyx_t_5);
16166 __Pyx_GIVEREF(__pyx_t_4);
16167 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
16169 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
16170 __Pyx_GOTREF(__pyx_t_4);
16171 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
16172 __Pyx_GOTREF(__pyx_t_6);
16173 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16174 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16175 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
16176 __Pyx_GOTREF(__pyx_t_4);
16177 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16178 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16179 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
16180 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
16200 __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
16202 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
16203 __Pyx_GOTREF(__pyx_t_6);
16204 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
16205 __Pyx_GOTREF(__pyx_t_1);
16208 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
16209 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16210 if (likely(__pyx_t_5)) {
16211 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
16212 __Pyx_INCREF(__pyx_t_5);
16213 __Pyx_INCREF(
function);
16214 __Pyx_DECREF_SET(__pyx_t_6,
function);
16218 #if CYTHON_FAST_PYCALL
16219 if (PyFunction_Check(__pyx_t_6)) {
16220 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
16221 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
16222 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16223 __Pyx_GOTREF(__pyx_t_4);
16224 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16227 #if CYTHON_FAST_PYCCALL
16228 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
16229 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
16230 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
16231 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16232 __Pyx_GOTREF(__pyx_t_4);
16233 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16237 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
16238 __Pyx_GOTREF(__pyx_t_8);
16240 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
16242 __Pyx_GIVEREF(__pyx_t_1);
16243 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
16244 __Pyx_INCREF(__pyx_v_value);
16245 __Pyx_GIVEREF(__pyx_v_value);
16246 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
16248 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
16249 __Pyx_GOTREF(__pyx_t_4);
16250 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16252 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16253 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
16254 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
16266 __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
16268 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
16269 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
16270 __PYX_ERR(1, 514, __pyx_L1_error)
16272 __Pyx_INCREF(__pyx_v_bytesvalue);
16273 __pyx_t_10 = __pyx_v_bytesvalue;
16274 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
16275 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
16276 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
16277 __pyx_t_11 = __pyx_t_14;
16278 __pyx_v_c = (__pyx_t_11[0]);
16287 __Pyx_TraceLine(515,0,__PYX_ERR(1, 515, __pyx_L1_error))
16288 __pyx_v_i = __pyx_t_9;
16297 __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
16298 __pyx_t_9 = (__pyx_t_9 + 1);
16307 __Pyx_TraceLine(515,0,__PYX_ERR(1, 515, __pyx_L1_error))
16308 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
16310 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16321 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16324 __Pyx_XDECREF(__pyx_t_1);
16325 __Pyx_XDECREF(__pyx_t_4);
16326 __Pyx_XDECREF(__pyx_t_5);
16327 __Pyx_XDECREF(__pyx_t_6);
16328 __Pyx_XDECREF(__pyx_t_8);
16329 __Pyx_XDECREF(__pyx_t_10);
16330 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16333 __Pyx_XDECREF(__pyx_v_struct);
16334 __Pyx_XDECREF(__pyx_v_bytesvalue);
16335 __Pyx_XGIVEREF(__pyx_r);
16336 __Pyx_TraceReturn(__pyx_r, 0);
16337 __Pyx_RefNannyFinishContext();
16350 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
16351 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
16353 __Pyx_RefNannyDeclarations
16354 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
16355 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
16358 __Pyx_RefNannyFinishContext();
16362 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
16364 __Pyx_TraceDeclarations
16365 __Pyx_RefNannyDeclarations
16368 PyObject *__pyx_t_3 = NULL;
16369 Py_ssize_t *__pyx_t_4;
16373 Py_ssize_t __pyx_t_8;
16374 int __pyx_lineno = 0;
16375 const char *__pyx_filename = NULL;
16376 int __pyx_clineno = 0;
16377 if (__pyx_v_info == NULL) {
16378 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
16381 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
16382 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
16383 __Pyx_GIVEREF(__pyx_v_info->obj);
16384 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 518, 0, __PYX_ERR(1, 518, __pyx_L1_error));
16393 __Pyx_TraceLine(519,0,__PYX_ERR(1, 519, __pyx_L1_error))
16394 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
16397 __pyx_t_1 = __pyx_t_2;
16398 goto __pyx_L4_bool_binop_done;
16400 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
16401 __pyx_t_1 = __pyx_t_2;
16402 __pyx_L4_bool_binop_done:;
16403 if (unlikely(__pyx_t_1)) {
16412 __Pyx_TraceLine(520,0,__PYX_ERR(1, 520, __pyx_L1_error))
16413 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
16414 __Pyx_GOTREF(__pyx_t_3);
16415 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16416 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16417 __PYX_ERR(1, 520, __pyx_L1_error)
16435 __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
16436 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
16446 __Pyx_TraceLine(523,0,__PYX_ERR(1, 523, __pyx_L1_error))
16447 __pyx_t_4 = __pyx_v_self->view.shape;
16448 __pyx_v_info->shape = __pyx_t_4;
16467 __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
16469 __pyx_v_info->shape = NULL;
16480 __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
16481 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
16491 __Pyx_TraceLine(528,0,__PYX_ERR(1, 528, __pyx_L1_error))
16492 __pyx_t_4 = __pyx_v_self->view.strides;
16493 __pyx_v_info->strides = __pyx_t_4;
16512 __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
16514 __pyx_v_info->strides = NULL;
16525 __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
16526 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
16536 __Pyx_TraceLine(533,0,__PYX_ERR(1, 533, __pyx_L1_error))
16537 __pyx_t_4 = __pyx_v_self->view.suboffsets;
16538 __pyx_v_info->suboffsets = __pyx_t_4;
16557 __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
16559 __pyx_v_info->suboffsets = NULL;
16570 __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
16571 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
16581 __Pyx_TraceLine(538,0,__PYX_ERR(1, 538, __pyx_L1_error))
16582 __pyx_t_5 = __pyx_v_self->view.format;
16583 __pyx_v_info->format = __pyx_t_5;
16602 __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
16604 __pyx_v_info->format = NULL;
16615 __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
16616 __pyx_t_6 = __pyx_v_self->view.buf;
16617 __pyx_v_info->buf = __pyx_t_6;
16626 __Pyx_TraceLine(543,0,__PYX_ERR(1, 543, __pyx_L1_error))
16627 __pyx_t_7 = __pyx_v_self->view.ndim;
16628 __pyx_v_info->ndim = __pyx_t_7;
16637 __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
16638 __pyx_t_8 = __pyx_v_self->view.itemsize;
16639 __pyx_v_info->itemsize = __pyx_t_8;
16648 __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
16649 __pyx_t_8 = __pyx_v_self->view.len;
16650 __pyx_v_info->len = __pyx_t_8;
16659 __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
16660 __pyx_t_1 = __pyx_v_self->view.readonly;
16661 __pyx_v_info->readonly = __pyx_t_1;
16670 __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
16671 __Pyx_INCREF(((PyObject *)__pyx_v_self));
16672 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
16673 __Pyx_GOTREF(__pyx_v_info->obj);
16674 __Pyx_DECREF(__pyx_v_info->obj);
16675 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
16689 __Pyx_XDECREF(__pyx_t_3);
16690 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16692 if (__pyx_v_info->obj != NULL) {
16693 __Pyx_GOTREF(__pyx_v_info->obj);
16694 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
16698 if (__pyx_v_info->obj == Py_None) {
16699 __Pyx_GOTREF(__pyx_v_info->obj);
16700 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
16703 __Pyx_TraceReturn(Py_None, 0);
16704 __Pyx_RefNannyFinishContext();
16717 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
16718 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
16719 PyObject *__pyx_r = 0;
16720 __Pyx_RefNannyDeclarations
16721 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
16722 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
16725 __Pyx_RefNannyFinishContext();
16729 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
16730 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16731 PyObject *__pyx_r = NULL;
16732 __Pyx_TraceDeclarations
16733 __Pyx_RefNannyDeclarations
16734 PyObject *__pyx_t_1 = NULL;
16736 int __pyx_lineno = 0;
16737 const char *__pyx_filename = NULL;
16738 int __pyx_clineno = 0;
16739 __Pyx_RefNannySetupContext(
"__get__", 0);
16740 __Pyx_TraceCall(
"__get__", __pyx_f[1], 553, 0, __PYX_ERR(1, 553, __pyx_L1_error));
16749 __Pyx_TraceLine(554,0,__PYX_ERR(1, 554, __pyx_L1_error))
16750 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
16751 __Pyx_GOTREF(__pyx_t_1);
16752 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
16753 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
16763 __Pyx_TraceLine(555,0,__PYX_ERR(1, 555, __pyx_L1_error))
16764 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
16773 __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
16774 __Pyx_XDECREF(__pyx_r);
16775 __Pyx_INCREF(((PyObject *)__pyx_v_result));
16776 __pyx_r = ((PyObject *)__pyx_v_result);
16789 __Pyx_XDECREF(__pyx_t_1);
16790 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16793 __Pyx_XDECREF((PyObject *)__pyx_v_result);
16794 __Pyx_XGIVEREF(__pyx_r);
16795 __Pyx_TraceReturn(__pyx_r, 0);
16796 __Pyx_RefNannyFinishContext();
16809 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
16810 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
16811 PyObject *__pyx_r = 0;
16812 __Pyx_RefNannyDeclarations
16813 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
16814 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
16817 __Pyx_RefNannyFinishContext();
16821 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
16822 PyObject *__pyx_r = NULL;
16823 __Pyx_TraceDeclarations
16824 __Pyx_RefNannyDeclarations
16825 int __pyx_lineno = 0;
16826 const char *__pyx_filename = NULL;
16827 int __pyx_clineno = 0;
16828 __Pyx_RefNannySetupContext(
"__get__", 0);
16829 __Pyx_TraceCall(
"__get__", __pyx_f[1], 559, 0, __PYX_ERR(1, 559, __pyx_L1_error));
16838 __Pyx_TraceLine(560,0,__PYX_ERR(1, 560, __pyx_L1_error))
16839 __Pyx_XDECREF(__pyx_r);
16840 __Pyx_INCREF(__pyx_v_self->obj);
16841 __pyx_r = __pyx_v_self->obj;
16854 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16857 __Pyx_XGIVEREF(__pyx_r);
16858 __Pyx_TraceReturn(__pyx_r, 0);
16859 __Pyx_RefNannyFinishContext();
16872 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
16873 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
16874 PyObject *__pyx_r = 0;
16875 __Pyx_RefNannyDeclarations
16876 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
16877 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
16880 __Pyx_RefNannyFinishContext();
16884 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
16885 Py_ssize_t __pyx_v_length;
16886 PyObject *__pyx_r = NULL;
16887 __Pyx_TraceDeclarations
16888 __Pyx_RefNannyDeclarations
16889 PyObject *__pyx_t_1 = NULL;
16890 Py_ssize_t *__pyx_t_2;
16891 Py_ssize_t *__pyx_t_3;
16892 Py_ssize_t *__pyx_t_4;
16893 PyObject *__pyx_t_5 = NULL;
16894 int __pyx_lineno = 0;
16895 const char *__pyx_filename = NULL;
16896 int __pyx_clineno = 0;
16897 __Pyx_RefNannySetupContext(
"__get__", 0);
16898 __Pyx_TraceCall(
"__get__", __pyx_f[1], 563, 0, __PYX_ERR(1, 563, __pyx_L1_error));
16907 __Pyx_TraceLine(564,0,__PYX_ERR(1, 564, __pyx_L1_error))
16908 __Pyx_XDECREF(__pyx_r);
16909 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
16910 __Pyx_GOTREF(__pyx_t_1);
16911 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
16912 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
16913 __pyx_t_2 = __pyx_t_4;
16914 __pyx_v_length = (__pyx_t_2[0]);
16915 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
16916 __Pyx_GOTREF(__pyx_t_5);
16917 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
16918 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16920 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
16921 __Pyx_GOTREF(__pyx_t_5);
16922 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16923 __pyx_r = __pyx_t_5;
16937 __Pyx_XDECREF(__pyx_t_1);
16938 __Pyx_XDECREF(__pyx_t_5);
16939 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16942 __Pyx_XGIVEREF(__pyx_r);
16943 __Pyx_TraceReturn(__pyx_r, 0);
16944 __Pyx_RefNannyFinishContext();
16957 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
16958 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
16959 PyObject *__pyx_r = 0;
16960 __Pyx_RefNannyDeclarations
16961 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
16962 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
16965 __Pyx_RefNannyFinishContext();
16969 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
16970 Py_ssize_t __pyx_v_stride;
16971 PyObject *__pyx_r = NULL;
16972 __Pyx_TraceDeclarations
16973 __Pyx_RefNannyDeclarations
16975 PyObject *__pyx_t_2 = NULL;
16976 Py_ssize_t *__pyx_t_3;
16977 Py_ssize_t *__pyx_t_4;
16978 Py_ssize_t *__pyx_t_5;
16979 PyObject *__pyx_t_6 = NULL;
16980 int __pyx_lineno = 0;
16981 const char *__pyx_filename = NULL;
16982 int __pyx_clineno = 0;
16983 __Pyx_RefNannySetupContext(
"__get__", 0);
16984 __Pyx_TraceCall(
"__get__", __pyx_f[1], 567, 0, __PYX_ERR(1, 567, __pyx_L1_error));
16993 __Pyx_TraceLine(568,0,__PYX_ERR(1, 568, __pyx_L1_error))
16994 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
16995 if (unlikely(__pyx_t_1)) {
17004 __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
17005 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
17006 __Pyx_GOTREF(__pyx_t_2);
17007 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
17008 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17009 __PYX_ERR(1, 570, __pyx_L1_error)
17027 __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
17028 __Pyx_XDECREF(__pyx_r);
17029 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
17030 __Pyx_GOTREF(__pyx_t_2);
17031 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
17032 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
17033 __pyx_t_3 = __pyx_t_5;
17034 __pyx_v_stride = (__pyx_t_3[0]);
17035 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
17036 __Pyx_GOTREF(__pyx_t_6);
17037 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
17038 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17040 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
17041 __Pyx_GOTREF(__pyx_t_6);
17042 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17043 __pyx_r = __pyx_t_6;
17057 __Pyx_XDECREF(__pyx_t_2);
17058 __Pyx_XDECREF(__pyx_t_6);
17059 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17062 __Pyx_XGIVEREF(__pyx_r);
17063 __Pyx_TraceReturn(__pyx_r, 0);
17064 __Pyx_RefNannyFinishContext();
17077 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
17078 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
17079 PyObject *__pyx_r = 0;
17080 __Pyx_RefNannyDeclarations
17081 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17082 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17085 __Pyx_RefNannyFinishContext();
17089 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17090 Py_ssize_t __pyx_v_suboffset;
17091 PyObject *__pyx_r = NULL;
17092 __Pyx_TraceDeclarations
17093 __Pyx_RefNannyDeclarations
17095 PyObject *__pyx_t_2 = NULL;
17096 PyObject *__pyx_t_3 = NULL;
17097 Py_ssize_t *__pyx_t_4;
17098 Py_ssize_t *__pyx_t_5;
17099 Py_ssize_t *__pyx_t_6;
17100 int __pyx_lineno = 0;
17101 const char *__pyx_filename = NULL;
17102 int __pyx_clineno = 0;
17103 __Pyx_RefNannySetupContext(
"__get__", 0);
17104 __Pyx_TraceCall(
"__get__", __pyx_f[1], 575, 0, __PYX_ERR(1, 575, __pyx_L1_error));
17113 __Pyx_TraceLine(576,0,__PYX_ERR(1, 576, __pyx_L1_error))
17114 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
17124 __Pyx_TraceLine(577,0,__PYX_ERR(1, 577, __pyx_L1_error))
17125 __Pyx_XDECREF(__pyx_r);
17126 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
17127 __Pyx_GOTREF(__pyx_t_2);
17128 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__33, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
17129 __Pyx_GOTREF(__pyx_t_3);
17130 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17131 __pyx_r = __pyx_t_3;
17151 __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
17152 __Pyx_XDECREF(__pyx_r);
17153 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
17154 __Pyx_GOTREF(__pyx_t_3);
17155 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
17156 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
17157 __pyx_t_4 = __pyx_t_6;
17158 __pyx_v_suboffset = (__pyx_t_4[0]);
17159 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
17160 __Pyx_GOTREF(__pyx_t_2);
17161 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
17162 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17164 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
17165 __Pyx_GOTREF(__pyx_t_2);
17166 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17167 __pyx_r = __pyx_t_2;
17181 __Pyx_XDECREF(__pyx_t_2);
17182 __Pyx_XDECREF(__pyx_t_3);
17183 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17186 __Pyx_XGIVEREF(__pyx_r);
17187 __Pyx_TraceReturn(__pyx_r, 0);
17188 __Pyx_RefNannyFinishContext();
17201 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
17202 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
17203 PyObject *__pyx_r = 0;
17204 __Pyx_RefNannyDeclarations
17205 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17206 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17209 __Pyx_RefNannyFinishContext();
17213 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17214 PyObject *__pyx_r = NULL;
17215 __Pyx_TraceDeclarations
17216 __Pyx_RefNannyDeclarations
17217 PyObject *__pyx_t_1 = NULL;
17218 int __pyx_lineno = 0;
17219 const char *__pyx_filename = NULL;
17220 int __pyx_clineno = 0;
17221 __Pyx_RefNannySetupContext(
"__get__", 0);
17222 __Pyx_TraceCall(
"__get__", __pyx_f[1], 582, 0, __PYX_ERR(1, 582, __pyx_L1_error));
17231 __Pyx_TraceLine(583,0,__PYX_ERR(1, 583, __pyx_L1_error))
17232 __Pyx_XDECREF(__pyx_r);
17233 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
17234 __Pyx_GOTREF(__pyx_t_1);
17235 __pyx_r = __pyx_t_1;
17249 __Pyx_XDECREF(__pyx_t_1);
17250 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17253 __Pyx_XGIVEREF(__pyx_r);
17254 __Pyx_TraceReturn(__pyx_r, 0);
17255 __Pyx_RefNannyFinishContext();
17268 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
17269 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
17270 PyObject *__pyx_r = 0;
17271 __Pyx_RefNannyDeclarations
17272 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17273 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17276 __Pyx_RefNannyFinishContext();
17280 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17281 PyObject *__pyx_r = NULL;
17282 __Pyx_TraceDeclarations
17283 __Pyx_RefNannyDeclarations
17284 PyObject *__pyx_t_1 = NULL;
17285 int __pyx_lineno = 0;
17286 const char *__pyx_filename = NULL;
17287 int __pyx_clineno = 0;
17288 __Pyx_RefNannySetupContext(
"__get__", 0);
17289 __Pyx_TraceCall(
"__get__", __pyx_f[1], 586, 0, __PYX_ERR(1, 586, __pyx_L1_error));
17298 __Pyx_TraceLine(587,0,__PYX_ERR(1, 587, __pyx_L1_error))
17299 __Pyx_XDECREF(__pyx_r);
17300 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
17301 __Pyx_GOTREF(__pyx_t_1);
17302 __pyx_r = __pyx_t_1;
17316 __Pyx_XDECREF(__pyx_t_1);
17317 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17320 __Pyx_XGIVEREF(__pyx_r);
17321 __Pyx_TraceReturn(__pyx_r, 0);
17322 __Pyx_RefNannyFinishContext();
17335 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
17336 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
17337 PyObject *__pyx_r = 0;
17338 __Pyx_RefNannyDeclarations
17339 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17340 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17343 __Pyx_RefNannyFinishContext();
17347 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17348 PyObject *__pyx_r = NULL;
17349 __Pyx_TraceDeclarations
17350 __Pyx_RefNannyDeclarations
17351 PyObject *__pyx_t_1 = NULL;
17352 PyObject *__pyx_t_2 = NULL;
17353 PyObject *__pyx_t_3 = NULL;
17354 int __pyx_lineno = 0;
17355 const char *__pyx_filename = NULL;
17356 int __pyx_clineno = 0;
17357 __Pyx_RefNannySetupContext(
"__get__", 0);
17358 __Pyx_TraceCall(
"__get__", __pyx_f[1], 590, 0, __PYX_ERR(1, 590, __pyx_L1_error));
17367 __Pyx_TraceLine(591,0,__PYX_ERR(1, 591, __pyx_L1_error))
17368 __Pyx_XDECREF(__pyx_r);
17369 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
17370 __Pyx_GOTREF(__pyx_t_1);
17371 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
17372 __Pyx_GOTREF(__pyx_t_2);
17373 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
17374 __Pyx_GOTREF(__pyx_t_3);
17375 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17376 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17377 __pyx_r = __pyx_t_3;
17391 __Pyx_XDECREF(__pyx_t_1);
17392 __Pyx_XDECREF(__pyx_t_2);
17393 __Pyx_XDECREF(__pyx_t_3);
17394 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17397 __Pyx_XGIVEREF(__pyx_r);
17398 __Pyx_TraceReturn(__pyx_r, 0);
17399 __Pyx_RefNannyFinishContext();
17412 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
17413 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
17414 PyObject *__pyx_r = 0;
17415 __Pyx_RefNannyDeclarations
17416 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17417 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17420 __Pyx_RefNannyFinishContext();
17424 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17425 PyObject *__pyx_v_result = NULL;
17426 PyObject *__pyx_v_length = NULL;
17427 PyObject *__pyx_r = NULL;
17428 __Pyx_TraceDeclarations
17429 __Pyx_RefNannyDeclarations
17432 Py_ssize_t *__pyx_t_3;
17433 Py_ssize_t *__pyx_t_4;
17434 Py_ssize_t *__pyx_t_5;
17435 PyObject *__pyx_t_6 = NULL;
17436 int __pyx_lineno = 0;
17437 const char *__pyx_filename = NULL;
17438 int __pyx_clineno = 0;
17439 __Pyx_RefNannySetupContext(
"__get__", 0);
17440 __Pyx_TraceCall(
"__get__", __pyx_f[1], 594, 0, __PYX_ERR(1, 594, __pyx_L1_error));
17449 __Pyx_TraceLine(595,0,__PYX_ERR(1, 595, __pyx_L1_error))
17450 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
17451 __pyx_t_2 = (__pyx_t_1 != 0);
17461 __Pyx_TraceLine(596,0,__PYX_ERR(1, 596, __pyx_L1_error))
17462 __Pyx_INCREF(__pyx_int_1);
17463 __pyx_v_result = __pyx_int_1;
17472 __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
17473 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
17474 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
17475 __pyx_t_3 = __pyx_t_5;
17476 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
17477 __Pyx_GOTREF(__pyx_t_6);
17478 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
17488 __Pyx_TraceLine(599,0,__PYX_ERR(1, 599, __pyx_L1_error))
17489 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
17490 __Pyx_GOTREF(__pyx_t_6);
17491 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
17502 __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
17503 __Pyx_INCREF(__pyx_v_result);
17504 __Pyx_GIVEREF(__pyx_v_result);
17505 __Pyx_GOTREF(__pyx_v_self->_size);
17506 __Pyx_DECREF(__pyx_v_self->_size);
17507 __pyx_v_self->_size = __pyx_v_result;
17525 __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
17526 __Pyx_XDECREF(__pyx_r);
17527 __Pyx_INCREF(__pyx_v_self->_size);
17528 __pyx_r = __pyx_v_self->_size;
17541 __Pyx_XDECREF(__pyx_t_6);
17542 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17545 __Pyx_XDECREF(__pyx_v_result);
17546 __Pyx_XDECREF(__pyx_v_length);
17547 __Pyx_XGIVEREF(__pyx_r);
17548 __Pyx_TraceReturn(__pyx_r, 0);
17549 __Pyx_RefNannyFinishContext();
17562 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
17563 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
17564 Py_ssize_t __pyx_r;
17565 __Pyx_RefNannyDeclarations
17566 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
17567 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17570 __Pyx_RefNannyFinishContext();
17574 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17575 Py_ssize_t __pyx_r;
17576 __Pyx_TraceDeclarations
17577 __Pyx_RefNannyDeclarations
17579 int __pyx_lineno = 0;
17580 const char *__pyx_filename = NULL;
17581 int __pyx_clineno = 0;
17582 __Pyx_RefNannySetupContext(
"__len__", 0);
17583 __Pyx_TraceCall(
"__len__", __pyx_f[1], 605, 0, __PYX_ERR(1, 605, __pyx_L1_error));
17592 __Pyx_TraceLine(606,0,__PYX_ERR(1, 606, __pyx_L1_error))
17593 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
17603 __Pyx_TraceLine(607,0,__PYX_ERR(1, 607, __pyx_L1_error))
17604 __pyx_r = (__pyx_v_self->view.shape[0]);
17623 __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
17637 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17640 __Pyx_TraceReturn(Py_None, 0);
17641 __Pyx_RefNannyFinishContext();
17654 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
17655 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
17656 PyObject *__pyx_r = 0;
17657 __Pyx_RefNannyDeclarations
17658 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
17659 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17662 __Pyx_RefNannyFinishContext();
17666 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17667 PyObject *__pyx_r = NULL;
17668 __Pyx_TraceDeclarations
17669 __Pyx_RefNannyDeclarations
17670 PyObject *__pyx_t_1 = NULL;
17671 PyObject *__pyx_t_2 = NULL;
17672 PyObject *__pyx_t_3 = NULL;
17673 int __pyx_lineno = 0;
17674 const char *__pyx_filename = NULL;
17675 int __pyx_clineno = 0;
17676 __Pyx_RefNannySetupContext(
"__repr__", 0);
17677 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 611, 0, __PYX_ERR(1, 611, __pyx_L1_error));
17686 __Pyx_TraceLine(612,0,__PYX_ERR(1, 612, __pyx_L1_error))
17687 __Pyx_XDECREF(__pyx_r);
17688 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
17689 __Pyx_GOTREF(__pyx_t_1);
17690 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
17691 __Pyx_GOTREF(__pyx_t_2);
17692 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17693 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
17694 __Pyx_GOTREF(__pyx_t_1);
17695 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17704 __Pyx_TraceLine(613,0,__PYX_ERR(1, 613, __pyx_L1_error))
17705 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
17706 __Pyx_GOTREF(__pyx_t_2);
17715 __Pyx_TraceLine(612,0,__PYX_ERR(1, 612, __pyx_L1_error))
17716 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
17717 __Pyx_GOTREF(__pyx_t_3);
17718 __Pyx_GIVEREF(__pyx_t_1);
17719 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
17720 __Pyx_GIVEREF(__pyx_t_2);
17721 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
17724 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
17725 __Pyx_GOTREF(__pyx_t_2);
17726 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17727 __pyx_r = __pyx_t_2;
17741 __Pyx_XDECREF(__pyx_t_1);
17742 __Pyx_XDECREF(__pyx_t_2);
17743 __Pyx_XDECREF(__pyx_t_3);
17744 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17747 __Pyx_XGIVEREF(__pyx_r);
17748 __Pyx_TraceReturn(__pyx_r, 0);
17749 __Pyx_RefNannyFinishContext();
17762 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
17763 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
17764 PyObject *__pyx_r = 0;
17765 __Pyx_RefNannyDeclarations
17766 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
17767 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17770 __Pyx_RefNannyFinishContext();
17774 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17775 PyObject *__pyx_r = NULL;
17776 __Pyx_TraceDeclarations
17777 __Pyx_RefNannyDeclarations
17778 PyObject *__pyx_t_1 = NULL;
17779 PyObject *__pyx_t_2 = NULL;
17780 int __pyx_lineno = 0;
17781 const char *__pyx_filename = NULL;
17782 int __pyx_clineno = 0;
17783 __Pyx_RefNannySetupContext(
"__str__", 0);
17784 __Pyx_TraceCall(
"__str__", __pyx_f[1], 615, 0, __PYX_ERR(1, 615, __pyx_L1_error));
17793 __Pyx_TraceLine(616,0,__PYX_ERR(1, 616, __pyx_L1_error))
17794 __Pyx_XDECREF(__pyx_r);
17795 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
17796 __Pyx_GOTREF(__pyx_t_1);
17797 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
17798 __Pyx_GOTREF(__pyx_t_2);
17799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17800 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
17801 __Pyx_GOTREF(__pyx_t_1);
17802 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17803 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
17804 __Pyx_GOTREF(__pyx_t_2);
17805 __Pyx_GIVEREF(__pyx_t_1);
17806 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
17808 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
17809 __Pyx_GOTREF(__pyx_t_1);
17810 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17811 __pyx_r = __pyx_t_1;
17825 __Pyx_XDECREF(__pyx_t_1);
17826 __Pyx_XDECREF(__pyx_t_2);
17827 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17830 __Pyx_XGIVEREF(__pyx_r);
17831 __Pyx_TraceReturn(__pyx_r, 0);
17832 __Pyx_RefNannyFinishContext();
17845 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
17846 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
17847 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17848 PyObject *__pyx_r = 0;
17849 __Pyx_RefNannyDeclarations
17850 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
17851 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17854 __Pyx_RefNannyFinishContext();
17858 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
17859 __Pyx_memviewslice *__pyx_v_mslice;
17860 __Pyx_memviewslice __pyx_v_tmp;
17861 PyObject *__pyx_r = NULL;
17862 __Pyx_TraceDeclarations
17863 __Pyx_RefNannyDeclarations
17864 __Pyx_memviewslice *__pyx_t_1;
17865 PyObject *__pyx_t_2 = NULL;
17866 int __pyx_lineno = 0;
17867 const char *__pyx_filename = NULL;
17868 int __pyx_clineno = 0;
17869 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
17870 __Pyx_TraceCall(
"is_c_contig", __pyx_f[1], 619, 0, __PYX_ERR(1, 619, __pyx_L1_error));
17879 __Pyx_TraceLine(622,0,__PYX_ERR(1, 622, __pyx_L1_error))
17880 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
17881 __pyx_v_mslice = __pyx_t_1;
17890 __Pyx_TraceLine(623,0,__PYX_ERR(1, 623, __pyx_L1_error))
17891 __Pyx_XDECREF(__pyx_r);
17892 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
17893 __Pyx_GOTREF(__pyx_t_2);
17894 __pyx_r = __pyx_t_2;
17908 __Pyx_XDECREF(__pyx_t_2);
17909 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
17912 __Pyx_XGIVEREF(__pyx_r);
17913 __Pyx_TraceReturn(__pyx_r, 0);
17914 __Pyx_RefNannyFinishContext();
17927 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
17928 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
17929 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17930 PyObject *__pyx_r = 0;
17931 __Pyx_RefNannyDeclarations
17932 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
17933 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17936 __Pyx_RefNannyFinishContext();
17940 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
17941 __Pyx_memviewslice *__pyx_v_mslice;
17942 __Pyx_memviewslice __pyx_v_tmp;
17943 PyObject *__pyx_r = NULL;
17944 __Pyx_TraceDeclarations
17945 __Pyx_RefNannyDeclarations
17946 __Pyx_memviewslice *__pyx_t_1;
17947 PyObject *__pyx_t_2 = NULL;
17948 int __pyx_lineno = 0;
17949 const char *__pyx_filename = NULL;
17950 int __pyx_clineno = 0;
17951 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
17952 __Pyx_TraceCall(
"is_f_contig", __pyx_f[1], 625, 0, __PYX_ERR(1, 625, __pyx_L1_error));
17961 __Pyx_TraceLine(628,0,__PYX_ERR(1, 628, __pyx_L1_error))
17962 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
17963 __pyx_v_mslice = __pyx_t_1;
17972 __Pyx_TraceLine(629,0,__PYX_ERR(1, 629, __pyx_L1_error))
17973 __Pyx_XDECREF(__pyx_r);
17974 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
17975 __Pyx_GOTREF(__pyx_t_2);
17976 __pyx_r = __pyx_t_2;
17990 __Pyx_XDECREF(__pyx_t_2);
17991 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
17994 __Pyx_XGIVEREF(__pyx_r);
17995 __Pyx_TraceReturn(__pyx_r, 0);
17996 __Pyx_RefNannyFinishContext();
18009 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
18010 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
18011 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18012 PyObject *__pyx_r = 0;
18013 __Pyx_RefNannyDeclarations
18014 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
18015 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
18018 __Pyx_RefNannyFinishContext();
18022 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
18023 __Pyx_memviewslice __pyx_v_mslice;
18025 PyObject *__pyx_r = NULL;
18026 __Pyx_TraceDeclarations
18027 __Pyx_RefNannyDeclarations
18028 __Pyx_memviewslice __pyx_t_1;
18029 PyObject *__pyx_t_2 = NULL;
18030 int __pyx_lineno = 0;
18031 const char *__pyx_filename = NULL;
18032 int __pyx_clineno = 0;
18033 __Pyx_RefNannySetupContext(
"copy", 0);
18034 __Pyx_TraceCall(
"copy", __pyx_f[1], 631, 0, __PYX_ERR(1, 631, __pyx_L1_error));
18043 __Pyx_TraceLine(633,0,__PYX_ERR(1, 633, __pyx_L1_error))
18044 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
18053 __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
18054 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
18063 __Pyx_TraceLine(636,0,__PYX_ERR(1, 636, __pyx_L1_error))
18064 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
18065 __pyx_v_mslice = __pyx_t_1;
18074 __Pyx_TraceLine(641,0,__PYX_ERR(1, 641, __pyx_L1_error))
18075 __Pyx_XDECREF(__pyx_r);
18076 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
18077 __Pyx_GOTREF(__pyx_t_2);
18078 __pyx_r = __pyx_t_2;
18092 __Pyx_XDECREF(__pyx_t_2);
18093 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18096 __Pyx_XGIVEREF(__pyx_r);
18097 __Pyx_TraceReturn(__pyx_r, 0);
18098 __Pyx_RefNannyFinishContext();
18111 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
18112 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
18113 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18114 PyObject *__pyx_r = 0;
18115 __Pyx_RefNannyDeclarations
18116 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
18117 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
18120 __Pyx_RefNannyFinishContext();
18124 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
18125 __Pyx_memviewslice __pyx_v_src;
18126 __Pyx_memviewslice __pyx_v_dst;
18128 PyObject *__pyx_r = NULL;
18129 __Pyx_TraceDeclarations
18130 __Pyx_RefNannyDeclarations
18131 __Pyx_memviewslice __pyx_t_1;
18132 PyObject *__pyx_t_2 = NULL;
18133 int __pyx_lineno = 0;
18134 const char *__pyx_filename = NULL;
18135 int __pyx_clineno = 0;
18136 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
18137 __Pyx_TraceCall(
"copy_fortran", __pyx_f[1], 643, 0, __PYX_ERR(1, 643, __pyx_L1_error));
18146 __Pyx_TraceLine(645,0,__PYX_ERR(1, 645, __pyx_L1_error))
18147 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
18156 __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
18157 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
18166 __Pyx_TraceLine(648,0,__PYX_ERR(1, 648, __pyx_L1_error))
18167 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
18168 __pyx_v_dst = __pyx_t_1;
18177 __Pyx_TraceLine(653,0,__PYX_ERR(1, 653, __pyx_L1_error))
18178 __Pyx_XDECREF(__pyx_r);
18179 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
18180 __Pyx_GOTREF(__pyx_t_2);
18181 __pyx_r = __pyx_t_2;
18195 __Pyx_XDECREF(__pyx_t_2);
18196 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
18199 __Pyx_XGIVEREF(__pyx_r);
18200 __Pyx_TraceReturn(__pyx_r, 0);
18201 __Pyx_RefNannyFinishContext();
18212 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
18213 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
18214 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18215 PyObject *__pyx_r = 0;
18216 __Pyx_RefNannyDeclarations
18217 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
18218 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
18221 __Pyx_RefNannyFinishContext();
18225 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
18226 PyObject *__pyx_r = NULL;
18227 __Pyx_TraceDeclarations
18228 __Pyx_RefNannyDeclarations
18229 PyObject *__pyx_t_1 = NULL;
18230 int __pyx_lineno = 0;
18231 const char *__pyx_filename = NULL;
18232 int __pyx_clineno = 0;
18233 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
18234 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
18242 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
18243 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
18244 __Pyx_GOTREF(__pyx_t_1);
18245 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18246 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18247 __PYX_ERR(1, 2, __pyx_L1_error)
18257 __Pyx_XDECREF(__pyx_t_1);
18258 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18260 __Pyx_XGIVEREF(__pyx_r);
18261 __Pyx_TraceReturn(__pyx_r, 0);
18262 __Pyx_RefNannyFinishContext();
18274 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
18275 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
18276 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18277 PyObject *__pyx_r = 0;
18278 __Pyx_RefNannyDeclarations
18279 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
18280 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18283 __Pyx_RefNannyFinishContext();
18287 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18288 PyObject *__pyx_r = NULL;
18289 __Pyx_TraceDeclarations
18290 __Pyx_RefNannyDeclarations
18291 PyObject *__pyx_t_1 = NULL;
18292 int __pyx_lineno = 0;
18293 const char *__pyx_filename = NULL;
18294 int __pyx_clineno = 0;
18295 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
18296 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
18303 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
18304 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18305 __Pyx_GOTREF(__pyx_t_1);
18306 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18307 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18308 __PYX_ERR(1, 4, __pyx_L1_error)
18319 __Pyx_XDECREF(__pyx_t_1);
18320 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18322 __Pyx_XGIVEREF(__pyx_r);
18323 __Pyx_TraceReturn(__pyx_r, 0);
18324 __Pyx_RefNannyFinishContext();
18336 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
18337 struct __pyx_memoryview_obj *__pyx_v_result = 0;
18338 PyObject *__pyx_r = NULL;
18339 __Pyx_TraceDeclarations
18340 __Pyx_RefNannyDeclarations
18341 PyObject *__pyx_t_1 = NULL;
18342 PyObject *__pyx_t_2 = NULL;
18343 PyObject *__pyx_t_3 = NULL;
18344 int __pyx_lineno = 0;
18345 const char *__pyx_filename = NULL;
18346 int __pyx_clineno = 0;
18347 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
18348 __Pyx_TraceCall(
"memoryview_cwrapper", __pyx_f[1], 657, 0, __PYX_ERR(1, 657, __pyx_L1_error));
18357 __Pyx_TraceLine(658,0,__PYX_ERR(1, 658, __pyx_L1_error))
18358 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
18359 __Pyx_GOTREF(__pyx_t_1);
18360 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
18361 __Pyx_GOTREF(__pyx_t_2);
18362 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
18363 __Pyx_GOTREF(__pyx_t_3);
18364 __Pyx_INCREF(__pyx_v_o);
18365 __Pyx_GIVEREF(__pyx_v_o);
18366 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
18367 __Pyx_GIVEREF(__pyx_t_1);
18368 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
18369 __Pyx_GIVEREF(__pyx_t_2);
18370 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18373 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
18374 __Pyx_GOTREF(__pyx_t_2);
18375 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18376 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
18386 __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
18387 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
18396 __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
18397 __Pyx_XDECREF(__pyx_r);
18398 __Pyx_INCREF(((PyObject *)__pyx_v_result));
18399 __pyx_r = ((PyObject *)__pyx_v_result);
18412 __Pyx_XDECREF(__pyx_t_1);
18413 __Pyx_XDECREF(__pyx_t_2);
18414 __Pyx_XDECREF(__pyx_t_3);
18415 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
18418 __Pyx_XDECREF((PyObject *)__pyx_v_result);
18419 __Pyx_XGIVEREF(__pyx_r);
18420 __Pyx_TraceReturn(__pyx_r, 0);
18421 __Pyx_RefNannyFinishContext();
18433 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
18435 __Pyx_TraceDeclarations
18436 __Pyx_RefNannyDeclarations
18438 int __pyx_lineno = 0;
18439 const char *__pyx_filename = NULL;
18440 int __pyx_clineno = 0;
18441 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
18442 __Pyx_TraceCall(
"memoryview_check", __pyx_f[1], 663, 0, __PYX_ERR(1, 663, __pyx_L1_error));
18451 __Pyx_TraceLine(664,0,__PYX_ERR(1, 664, __pyx_L1_error))
18452 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
18453 __pyx_r = __pyx_t_1;
18466 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18469 __Pyx_TraceReturn(Py_None, 0);
18470 __Pyx_RefNannyFinishContext();
18482 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
18483 PyObject *__pyx_v_tup = NULL;
18484 PyObject *__pyx_v_result = NULL;
18485 int __pyx_v_have_slices;
18486 int __pyx_v_seen_ellipsis;
18487 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
18488 PyObject *__pyx_v_item = NULL;
18489 Py_ssize_t __pyx_v_nslices;
18490 PyObject *__pyx_r = NULL;
18491 __Pyx_TraceDeclarations
18492 __Pyx_RefNannyDeclarations
18495 PyObject *__pyx_t_3 = NULL;
18496 PyObject *__pyx_t_4 = NULL;
18497 Py_ssize_t __pyx_t_5;
18498 PyObject *(*__pyx_t_6)(PyObject *);
18499 PyObject *__pyx_t_7 = NULL;
18500 Py_ssize_t __pyx_t_8;
18503 PyObject *__pyx_t_11 = NULL;
18504 int __pyx_lineno = 0;
18505 const char *__pyx_filename = NULL;
18506 int __pyx_clineno = 0;
18507 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
18508 __Pyx_TraceCall(
"_unellipsify", __pyx_f[1], 666, 0, __PYX_ERR(1, 666, __pyx_L1_error));
18517 __Pyx_TraceLine(671,0,__PYX_ERR(1, 671, __pyx_L1_error))
18518 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
18519 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
18529 __Pyx_TraceLine(672,0,__PYX_ERR(1, 672, __pyx_L1_error))
18530 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
18531 __Pyx_GOTREF(__pyx_t_3);
18532 __Pyx_INCREF(__pyx_v_index);
18533 __Pyx_GIVEREF(__pyx_v_index);
18534 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
18535 __pyx_v_tup = __pyx_t_3;
18555 __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
18557 __Pyx_INCREF(__pyx_v_index);
18558 __pyx_v_tup = __pyx_v_index;
18569 __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
18570 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
18571 __Pyx_GOTREF(__pyx_t_3);
18572 __pyx_v_result = ((PyObject*)__pyx_t_3);
18582 __Pyx_TraceLine(677,0,__PYX_ERR(1, 677, __pyx_L1_error))
18583 __pyx_v_have_slices = 0;
18592 __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
18593 __pyx_v_seen_ellipsis = 0;
18602 __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
18603 __Pyx_INCREF(__pyx_int_0);
18604 __pyx_t_3 = __pyx_int_0;
18605 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
18606 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
18609 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
18610 __Pyx_GOTREF(__pyx_t_4);
18611 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
18614 if (likely(!__pyx_t_6)) {
18615 if (likely(PyList_CheckExact(__pyx_t_4))) {
18616 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
18617 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18618 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
18620 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
18621 __Pyx_GOTREF(__pyx_t_7);
18624 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
18625 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18626 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
18628 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
18629 __Pyx_GOTREF(__pyx_t_7);
18633 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
18634 if (unlikely(!__pyx_t_7)) {
18635 PyObject* exc_type = PyErr_Occurred();
18637 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18638 else __PYX_ERR(1, 679, __pyx_L1_error)
18642 __Pyx_GOTREF(__pyx_t_7);
18644 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
18646 __Pyx_INCREF(__pyx_t_3);
18647 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
18648 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
18649 __Pyx_GOTREF(__pyx_t_7);
18650 __Pyx_DECREF(__pyx_t_3);
18651 __pyx_t_3 = __pyx_t_7;
18661 __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
18662 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
18663 __pyx_t_1 = (__pyx_t_2 != 0);
18673 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
18674 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
18684 __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
18685 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
18686 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
18687 __Pyx_GOTREF(__pyx_t_7);
18688 { Py_ssize_t __pyx_temp;
18689 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
18690 __Pyx_INCREF(__pyx_slice__36);
18691 __Pyx_GIVEREF(__pyx_slice__36);
18692 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__36);
18695 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
18696 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18705 __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
18706 __pyx_v_seen_ellipsis = 1;
18725 __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
18727 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__36);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
18738 __Pyx_TraceLine(686,0,__PYX_ERR(1, 686, __pyx_L1_error))
18739 __pyx_v_have_slices = 1;
18758 __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
18760 __pyx_t_2 = PySlice_Check(__pyx_v_item);
18761 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
18764 __pyx_t_1 = __pyx_t_10;
18765 goto __pyx_L9_bool_binop_done;
18767 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
18768 __pyx_t_1 = __pyx_t_10;
18769 __pyx_L9_bool_binop_done:;
18770 if (unlikely(__pyx_t_1)) {
18779 __Pyx_TraceLine(689,0,__PYX_ERR(1, 689, __pyx_L1_error))
18780 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
18781 __Pyx_GOTREF(__pyx_t_7);
18782 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
18783 __Pyx_GOTREF(__pyx_t_11);
18784 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18785 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
18786 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
18787 __PYX_ERR(1, 689, __pyx_L1_error)
18805 __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
18806 __pyx_t_10 = (__pyx_v_have_slices != 0);
18809 __pyx_t_1 = __pyx_t_10;
18810 goto __pyx_L11_bool_binop_done;
18812 __pyx_t_10 = PySlice_Check(__pyx_v_item);
18813 __pyx_t_2 = (__pyx_t_10 != 0);
18814 __pyx_t_1 = __pyx_t_2;
18815 __pyx_L11_bool_binop_done:;
18816 __pyx_v_have_slices = __pyx_t_1;
18825 __Pyx_TraceLine(692,0,__PYX_ERR(1, 692, __pyx_L1_error))
18826 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
18837 __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
18839 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18840 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18849 __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
18850 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
18851 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
18860 __Pyx_TraceLine(695,0,__PYX_ERR(1, 695, __pyx_L1_error))
18861 __pyx_t_1 = (__pyx_v_nslices != 0);
18871 __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
18872 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
18873 __Pyx_GOTREF(__pyx_t_3);
18874 { Py_ssize_t __pyx_temp;
18875 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
18876 __Pyx_INCREF(__pyx_slice__36);
18877 __Pyx_GIVEREF(__pyx_slice__36);
18878 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__36);
18881 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
18882 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18900 __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
18901 __Pyx_XDECREF(__pyx_r);
18902 if (!__pyx_v_have_slices) {
18904 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
18905 __Pyx_GOTREF(__pyx_t_4);
18906 __pyx_t_3 = __pyx_t_4;
18908 goto __pyx_L14_bool_binop_done;
18910 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
18911 __Pyx_GOTREF(__pyx_t_4);
18912 __pyx_t_3 = __pyx_t_4;
18914 __pyx_L14_bool_binop_done:;
18915 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
18916 __Pyx_GOTREF(__pyx_t_4);
18917 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
18918 __Pyx_GOTREF(__pyx_t_11);
18919 __Pyx_GIVEREF(__pyx_t_3);
18920 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
18921 __Pyx_GIVEREF(__pyx_t_4);
18922 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
18925 __pyx_r = ((PyObject*)__pyx_t_11);
18939 __Pyx_XDECREF(__pyx_t_3);
18940 __Pyx_XDECREF(__pyx_t_4);
18941 __Pyx_XDECREF(__pyx_t_7);
18942 __Pyx_XDECREF(__pyx_t_11);
18943 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
18946 __Pyx_XDECREF(__pyx_v_tup);
18947 __Pyx_XDECREF(__pyx_v_result);
18948 __Pyx_XDECREF(__pyx_v_idx);
18949 __Pyx_XDECREF(__pyx_v_item);
18950 __Pyx_XGIVEREF(__pyx_r);
18951 __Pyx_TraceReturn(__pyx_r, 0);
18952 __Pyx_RefNannyFinishContext();
18964 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
18965 Py_ssize_t __pyx_v_suboffset;
18966 PyObject *__pyx_r = NULL;
18967 __Pyx_TraceDeclarations
18968 __Pyx_RefNannyDeclarations
18969 Py_ssize_t *__pyx_t_1;
18970 Py_ssize_t *__pyx_t_2;
18971 Py_ssize_t *__pyx_t_3;
18973 PyObject *__pyx_t_5 = NULL;
18974 int __pyx_lineno = 0;
18975 const char *__pyx_filename = NULL;
18976 int __pyx_clineno = 0;
18977 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
18978 __Pyx_TraceCall(
"assert_direct_dimensions", __pyx_f[1], 700, 0, __PYX_ERR(1, 700, __pyx_L1_error));
18987 __Pyx_TraceLine(701,0,__PYX_ERR(1, 701, __pyx_L1_error))
18988 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
18989 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
18990 __pyx_t_1 = __pyx_t_3;
18991 __pyx_v_suboffset = (__pyx_t_1[0]);
19000 __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
19001 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
19002 if (unlikely(__pyx_t_4)) {
19011 __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
19012 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
19013 __Pyx_GOTREF(__pyx_t_5);
19014 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
19015 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19016 __PYX_ERR(1, 703, __pyx_L1_error)
19037 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19040 __Pyx_XDECREF(__pyx_t_5);
19041 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
19044 __Pyx_XGIVEREF(__pyx_r);
19045 __Pyx_TraceReturn(__pyx_r, 0);
19046 __Pyx_RefNannyFinishContext();
19058 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
19059 int __pyx_v_new_ndim;
19060 int __pyx_v_suboffset_dim;
19062 __Pyx_memviewslice __pyx_v_src;
19063 __Pyx_memviewslice __pyx_v_dst;
19064 __Pyx_memviewslice *__pyx_v_p_src;
19065 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
19066 __Pyx_memviewslice *__pyx_v_p_dst;
19067 int *__pyx_v_p_suboffset_dim;
19068 Py_ssize_t __pyx_v_start;
19069 Py_ssize_t __pyx_v_stop;
19070 Py_ssize_t __pyx_v_step;
19071 int __pyx_v_have_start;
19072 int __pyx_v_have_stop;
19073 int __pyx_v_have_step;
19074 PyObject *__pyx_v_index = NULL;
19075 struct __pyx_memoryview_obj *__pyx_r = NULL;
19076 __Pyx_TraceDeclarations
19077 __Pyx_RefNannyDeclarations
19080 PyObject *__pyx_t_3 = NULL;
19081 struct __pyx_memoryview_obj *__pyx_t_4;
19084 Py_ssize_t __pyx_t_7;
19085 PyObject *(*__pyx_t_8)(PyObject *);
19086 PyObject *__pyx_t_9 = NULL;
19087 Py_ssize_t __pyx_t_10;
19089 Py_ssize_t __pyx_t_12;
19090 int __pyx_lineno = 0;
19091 const char *__pyx_filename = NULL;
19092 int __pyx_clineno = 0;
19093 __Pyx_RefNannySetupContext(
"memview_slice", 0);
19094 __Pyx_TraceCall(
"memview_slice", __pyx_f[1], 710, 0, __PYX_ERR(1, 710, __pyx_L1_error));
19103 __Pyx_TraceLine(711,0,__PYX_ERR(1, 711, __pyx_L1_error))
19104 __pyx_v_new_ndim = 0;
19105 __pyx_v_suboffset_dim = -1;
19114 __Pyx_TraceLine(718,0,__PYX_ERR(1, 718, __pyx_L1_error))
19115 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
19124 __Pyx_TraceLine(722,0,__PYX_ERR(1, 722, __pyx_L1_error))
19125 #ifndef CYTHON_WITHOUT_ASSERTIONS
19126 if (unlikely(!Py_OptimizeFlag)) {
19127 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
19128 PyErr_SetNone(PyExc_AssertionError);
19129 __PYX_ERR(1, 722, __pyx_L1_error)
19141 __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
19142 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19143 __pyx_t_2 = (__pyx_t_1 != 0);
19153 __Pyx_TraceLine(725,0,__PYX_ERR(1, 725, __pyx_L1_error))
19154 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
19155 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
19156 __Pyx_INCREF(__pyx_t_3);
19157 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
19167 __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
19168 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
19187 __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
19189 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
19198 __Pyx_TraceLine(729,0,__PYX_ERR(1, 729, __pyx_L1_error))
19199 __pyx_v_p_src = (&__pyx_v_src);
19210 __Pyx_TraceLine(735,0,__PYX_ERR(1, 735, __pyx_L1_error))
19211 __pyx_t_4 = __pyx_v_p_src->memview;
19212 __pyx_v_dst.memview = __pyx_t_4;
19221 __Pyx_TraceLine(736,0,__PYX_ERR(1, 736, __pyx_L1_error))
19222 __pyx_t_5 = __pyx_v_p_src->data;
19223 __pyx_v_dst.data = __pyx_t_5;
19232 __Pyx_TraceLine(741,0,__PYX_ERR(1, 741, __pyx_L1_error))
19233 __pyx_v_p_dst = (&__pyx_v_dst);
19242 __Pyx_TraceLine(742,0,__PYX_ERR(1, 742, __pyx_L1_error))
19243 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
19252 __Pyx_TraceLine(746,0,__PYX_ERR(1, 746, __pyx_L1_error))
19254 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
19255 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
19258 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
19259 __Pyx_GOTREF(__pyx_t_3);
19260 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
19263 if (likely(!__pyx_t_8)) {
19264 if (likely(PyList_CheckExact(__pyx_t_3))) {
19265 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
19266 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19267 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
19269 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
19270 __Pyx_GOTREF(__pyx_t_9);
19273 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
19274 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19275 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
19277 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
19278 __Pyx_GOTREF(__pyx_t_9);
19282 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
19283 if (unlikely(!__pyx_t_9)) {
19284 PyObject* exc_type = PyErr_Occurred();
19286 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
19287 else __PYX_ERR(1, 746, __pyx_L1_error)
19291 __Pyx_GOTREF(__pyx_t_9);
19293 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
19295 __pyx_v_dim = __pyx_t_6;
19296 __pyx_t_6 = (__pyx_t_6 + 1);
19305 __Pyx_TraceLine(747,0,__PYX_ERR(1, 747, __pyx_L1_error))
19306 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
19316 __Pyx_TraceLine(751,0,__PYX_ERR(1, 751, __pyx_L1_error))
19317 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
19326 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
19327 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
19346 __Pyx_TraceLine(754,0,__PYX_ERR(1, 754, __pyx_L1_error))
19347 __pyx_t_2 = (__pyx_v_index == Py_None);
19348 __pyx_t_1 = (__pyx_t_2 != 0);
19358 __Pyx_TraceLine(755,0,__PYX_ERR(1, 755, __pyx_L1_error))
19359 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
19368 __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
19369 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
19378 __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
19379 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
19388 __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
19389 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
19408 __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
19410 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
19411 __Pyx_GOTREF(__pyx_t_9);
19412 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
19414 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19416 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
19417 __pyx_t_10 = __pyx_t_12;
19418 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19419 goto __pyx_L7_bool_binop_done;
19422 __pyx_L7_bool_binop_done:;
19423 __pyx_v_start = __pyx_t_10;
19432 __Pyx_TraceLine(761,0,__PYX_ERR(1, 761, __pyx_L1_error))
19433 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
19434 __Pyx_GOTREF(__pyx_t_9);
19435 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
19437 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19439 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
19440 __pyx_t_10 = __pyx_t_12;
19441 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19442 goto __pyx_L9_bool_binop_done;
19445 __pyx_L9_bool_binop_done:;
19446 __pyx_v_stop = __pyx_t_10;
19455 __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
19456 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
19457 __Pyx_GOTREF(__pyx_t_9);
19458 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
19460 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19462 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
19463 __pyx_t_10 = __pyx_t_12;
19464 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19465 goto __pyx_L11_bool_binop_done;
19468 __pyx_L11_bool_binop_done:;
19469 __pyx_v_step = __pyx_t_10;
19478 __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
19479 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
19480 __Pyx_GOTREF(__pyx_t_9);
19481 __pyx_t_1 = (__pyx_t_9 != Py_None);
19482 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19483 __pyx_v_have_start = __pyx_t_1;
19492 __Pyx_TraceLine(765,0,__PYX_ERR(1, 765, __pyx_L1_error))
19493 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
19494 __Pyx_GOTREF(__pyx_t_9);
19495 __pyx_t_1 = (__pyx_t_9 != Py_None);
19496 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19497 __pyx_v_have_stop = __pyx_t_1;
19506 __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
19507 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
19508 __Pyx_GOTREF(__pyx_t_9);
19509 __pyx_t_1 = (__pyx_t_9 != Py_None);
19510 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19511 __pyx_v_have_step = __pyx_t_1;
19520 __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
19521 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
19530 __Pyx_TraceLine(774,0,__PYX_ERR(1, 774, __pyx_L1_error))
19531 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
19542 __Pyx_TraceLine(746,0,__PYX_ERR(1, 746, __pyx_L1_error))
19544 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19553 __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
19554 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19555 __pyx_t_2 = (__pyx_t_1 != 0);
19565 __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error))
19566 __Pyx_XDECREF(((PyObject *)__pyx_r));
19575 __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
19576 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
19585 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
19586 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
19595 __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error))
19596 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
19597 __Pyx_GOTREF(__pyx_t_3);
19598 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
19599 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
19619 __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error))
19621 __Pyx_XDECREF(((PyObject *)__pyx_r));
19630 __Pyx_TraceLine(783,0,__PYX_ERR(1, 783, __pyx_L1_error))
19631 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
19632 __Pyx_GOTREF(__pyx_t_3);
19641 __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error))
19642 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
19643 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
19658 __Pyx_XDECREF(__pyx_t_3);
19659 __Pyx_XDECREF(__pyx_t_9);
19660 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19663 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
19664 __Pyx_XDECREF(__pyx_v_index);
19665 __Pyx_XGIVEREF((PyObject *)__pyx_r);
19666 __Pyx_TraceReturn(__pyx_r, 0);
19667 __Pyx_RefNannyFinishContext();
19679 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
19680 Py_ssize_t __pyx_v_new_shape;
19681 int __pyx_v_negative_step;
19683 __Pyx_TraceDeclarations
19687 int __pyx_lineno = 0;
19688 const char *__pyx_filename = NULL;
19689 int __pyx_clineno = 0;
19690 __Pyx_TraceCall(
"slice_memviewslice", __pyx_f[1], 807, 1, __PYX_ERR(1, 807, __pyx_L1_error));
19699 __Pyx_TraceLine(827,1,__PYX_ERR(1, 827, __pyx_L1_error))
19700 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
19710 __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
19711 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
19721 __Pyx_TraceLine(830,1,__PYX_ERR(1, 830, __pyx_L1_error))
19722 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
19740 __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
19741 __pyx_t_1 = (0 <= __pyx_v_start);
19743 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
19745 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
19755 __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
19756 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
19784 __Pyx_TraceLine(835,1,__PYX_ERR(1, 835, __pyx_L1_error))
19786 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
19789 __pyx_t_2 = __pyx_t_1;
19790 goto __pyx_L6_bool_binop_done;
19792 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
19793 __pyx_t_2 = __pyx_t_1;
19794 __pyx_L6_bool_binop_done:;
19795 __pyx_v_negative_step = __pyx_t_2;
19804 __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
19805 __pyx_t_1 = (__pyx_v_have_step != 0);
19808 __pyx_t_2 = __pyx_t_1;
19809 goto __pyx_L9_bool_binop_done;
19811 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
19812 __pyx_t_2 = __pyx_t_1;
19813 __pyx_L9_bool_binop_done:;
19823 __Pyx_TraceLine(838,1,__PYX_ERR(1, 838, __pyx_L1_error))
19824 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
19842 __Pyx_TraceLine(841,1,__PYX_ERR(1, 841, __pyx_L1_error))
19843 __pyx_t_2 = (__pyx_v_have_start != 0);
19853 __Pyx_TraceLine(842,1,__PYX_ERR(1, 842, __pyx_L1_error))
19854 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
19864 __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
19865 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
19874 __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
19875 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
19885 __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
19914 __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
19915 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
19925 __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
19926 __pyx_t_2 = (__pyx_v_negative_step != 0);
19936 __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
19937 __pyx_v_start = (__pyx_v_shape - 1);
19956 __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
19958 __pyx_v_start = __pyx_v_shape;
19989 __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
19991 __pyx_t_2 = (__pyx_v_negative_step != 0);
20001 __Pyx_TraceLine(853,1,__PYX_ERR(1, 853, __pyx_L1_error))
20002 __pyx_v_start = (__pyx_v_shape - 1);
20021 __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
20036 __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
20037 __pyx_t_2 = (__pyx_v_have_stop != 0);
20047 __Pyx_TraceLine(858,1,__PYX_ERR(1, 858, __pyx_L1_error))
20048 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
20058 __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
20059 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
20068 __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
20069 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
20079 __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
20108 __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
20109 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
20119 __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
20120 __pyx_v_stop = __pyx_v_shape;
20149 __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
20151 __pyx_t_2 = (__pyx_v_negative_step != 0);
20161 __Pyx_TraceLine(866,1,__PYX_ERR(1, 866, __pyx_L1_error))
20162 __pyx_v_stop = -1L;
20181 __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
20183 __pyx_v_stop = __pyx_v_shape;
20196 __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
20197 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
20207 __Pyx_TraceLine(871,1,__PYX_ERR(1, 871, __pyx_L1_error))
20226 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
20235 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
20245 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
20263 __Pyx_TraceLine(880,1,__PYX_ERR(1, 880, __pyx_L1_error))
20264 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
20274 __Pyx_TraceLine(881,1,__PYX_ERR(1, 881, __pyx_L1_error))
20275 __pyx_v_new_shape = 0;
20293 __Pyx_TraceLine(884,1,__PYX_ERR(1, 884, __pyx_L1_error))
20294 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
20303 __Pyx_TraceLine(885,1,__PYX_ERR(1, 885, __pyx_L1_error))
20304 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
20313 __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
20314 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
20325 __Pyx_TraceLine(889,1,__PYX_ERR(1, 889, __pyx_L1_error))
20326 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
20336 __Pyx_TraceLine(890,1,__PYX_ERR(1, 890, __pyx_L1_error))
20337 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
20356 __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
20358 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
20359 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
20370 __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
20371 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
20381 __Pyx_TraceLine(895,1,__PYX_ERR(1, 895, __pyx_L1_error))
20382 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
20392 __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
20393 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
20403 __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
20404 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
20423 __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
20433 __Pyx_TraceLine(900,1,__PYX_ERR(1, 900, __pyx_L1_error))
20434 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
20455 __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
20457 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
20477 __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
20493 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20495 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
20497 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20502 __Pyx_TraceReturn(Py_None, 1);
20514 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
20515 Py_ssize_t __pyx_v_shape;
20516 Py_ssize_t __pyx_v_stride;
20517 Py_ssize_t __pyx_v_suboffset;
20518 Py_ssize_t __pyx_v_itemsize;
20519 char *__pyx_v_resultp;
20521 __Pyx_TraceDeclarations
20522 __Pyx_RefNannyDeclarations
20523 Py_ssize_t __pyx_t_1;
20525 PyObject *__pyx_t_3 = NULL;
20526 PyObject *__pyx_t_4 = NULL;
20527 int __pyx_lineno = 0;
20528 const char *__pyx_filename = NULL;
20529 int __pyx_clineno = 0;
20530 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
20531 __Pyx_TraceCall(
"pybuffer_index", __pyx_f[1], 910, 0, __PYX_ERR(1, 910, __pyx_L1_error));
20540 __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
20541 __pyx_v_suboffset = -1L;
20550 __Pyx_TraceLine(913,0,__PYX_ERR(1, 913, __pyx_L1_error))
20551 __pyx_t_1 = __pyx_v_view->itemsize;
20552 __pyx_v_itemsize = __pyx_t_1;
20561 __Pyx_TraceLine(916,0,__PYX_ERR(1, 916, __pyx_L1_error))
20562 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
20572 __Pyx_TraceLine(917,0,__PYX_ERR(1, 917, __pyx_L1_error))
20573 if (unlikely(__pyx_v_itemsize == 0)) {
20574 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
20575 __PYX_ERR(1, 917, __pyx_L1_error)
20577 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
20578 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
20579 __PYX_ERR(1, 917, __pyx_L1_error)
20581 __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
20590 __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
20591 __pyx_v_stride = __pyx_v_itemsize;
20610 __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
20612 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
20621 __Pyx_TraceLine(921,0,__PYX_ERR(1, 921, __pyx_L1_error))
20622 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
20631 __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
20632 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
20642 __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
20643 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
20663 __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
20664 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
20674 __Pyx_TraceLine(926,0,__PYX_ERR(1, 926, __pyx_L1_error))
20675 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
20684 __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
20685 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
20686 if (unlikely(__pyx_t_2)) {
20695 __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
20696 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
20697 __Pyx_GOTREF(__pyx_t_3);
20698 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
20699 __Pyx_GOTREF(__pyx_t_4);
20700 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20701 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
20702 __Pyx_GOTREF(__pyx_t_3);
20703 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20704 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20705 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20706 __PYX_ERR(1, 928, __pyx_L1_error)
20733 __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
20734 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
20735 if (unlikely(__pyx_t_2)) {
20744 __Pyx_TraceLine(931,0,__PYX_ERR(1, 931, __pyx_L1_error))
20745 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
20746 __Pyx_GOTREF(__pyx_t_3);
20747 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
20748 __Pyx_GOTREF(__pyx_t_4);
20749 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20750 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
20751 __Pyx_GOTREF(__pyx_t_3);
20752 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20753 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20754 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20755 __PYX_ERR(1, 931, __pyx_L1_error)
20773 __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
20774 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
20783 __Pyx_TraceLine(934,0,__PYX_ERR(1, 934, __pyx_L1_error))
20784 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
20794 __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
20795 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
20813 __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
20814 __pyx_r = __pyx_v_resultp;
20827 __Pyx_XDECREF(__pyx_t_3);
20828 __Pyx_XDECREF(__pyx_t_4);
20829 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
20832 __Pyx_TraceReturn(Py_None, 0);
20833 __Pyx_RefNannyFinishContext();
20845 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
20847 Py_ssize_t *__pyx_v_shape;
20848 Py_ssize_t *__pyx_v_strides;
20852 __Pyx_TraceDeclarations
20854 Py_ssize_t *__pyx_t_2;
20857 Py_ssize_t __pyx_t_5;
20858 Py_ssize_t __pyx_t_6;
20862 int __pyx_lineno = 0;
20863 const char *__pyx_filename = NULL;
20864 int __pyx_clineno = 0;
20865 __Pyx_TraceCall(
"transpose_memslice", __pyx_f[1], 943, 1, __PYX_ERR(1, 943, __pyx_L1_error));
20874 __Pyx_TraceLine(944,1,__PYX_ERR(1, 944, __pyx_L1_error))
20875 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
20876 __pyx_v_ndim = __pyx_t_1;
20885 __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
20886 __pyx_t_2 = __pyx_v_memslice->shape;
20887 __pyx_v_shape = __pyx_t_2;
20896 __Pyx_TraceLine(947,1,__PYX_ERR(1, 947, __pyx_L1_error))
20897 __pyx_t_2 = __pyx_v_memslice->strides;
20898 __pyx_v_strides = __pyx_t_2;
20907 __Pyx_TraceLine(951,1,__PYX_ERR(1, 951, __pyx_L1_error))
20908 __pyx_t_3 = (__pyx_v_ndim / 2);
20909 __pyx_t_4 = __pyx_t_3;
20910 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
20911 __pyx_v_i = __pyx_t_1;
20920 __Pyx_TraceLine(952,1,__PYX_ERR(1, 952, __pyx_L1_error))
20921 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
20930 __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
20931 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
20932 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
20933 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
20934 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
20943 __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
20944 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
20945 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
20946 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
20947 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
20956 __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
20957 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
20960 __pyx_t_7 = __pyx_t_8;
20961 goto __pyx_L6_bool_binop_done;
20963 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
20964 __pyx_t_7 = __pyx_t_8;
20965 __pyx_L6_bool_binop_done:;
20975 __Pyx_TraceLine(957,1,__PYX_ERR(1, 957, __pyx_L1_error))
20976 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
20995 __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
21011 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21013 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
21015 __Pyx_PyGILState_Release(__pyx_gilstate_save);
21020 __Pyx_TraceReturn(Py_None, 1);
21033 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
21034 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
21035 __Pyx_RefNannyDeclarations
21036 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
21037 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21040 __Pyx_RefNannyFinishContext();
21043 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21044 __Pyx_TraceDeclarations
21045 __Pyx_RefNannyDeclarations
21046 int __pyx_lineno = 0;
21047 const char *__pyx_filename = NULL;
21048 int __pyx_clineno = 0;
21049 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
21050 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 976, 0, __PYX_ERR(1, 976, __pyx_L1_error));
21059 __Pyx_TraceLine(977,0,__PYX_ERR(1, 977, __pyx_L1_error))
21060 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
21073 __Pyx_WriteUnraisable(
"View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
21075 __Pyx_TraceReturn(Py_None, 0);
21076 __Pyx_RefNannyFinishContext();
21087 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
21088 PyObject *__pyx_r = NULL;
21089 __Pyx_TraceDeclarations
21090 __Pyx_RefNannyDeclarations
21092 PyObject *__pyx_t_2 = NULL;
21093 int __pyx_lineno = 0;
21094 const char *__pyx_filename = NULL;
21095 int __pyx_clineno = 0;
21096 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
21097 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error));
21106 __Pyx_TraceLine(980,0,__PYX_ERR(1, 980, __pyx_L1_error))
21107 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
21117 __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
21118 __Pyx_XDECREF(__pyx_r);
21119 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
21120 __Pyx_GOTREF(__pyx_t_2);
21121 __pyx_r = __pyx_t_2;
21141 __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
21143 __Pyx_XDECREF(__pyx_r);
21144 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
21145 __Pyx_GOTREF(__pyx_t_2);
21146 __pyx_r = __pyx_t_2;
21161 __Pyx_XDECREF(__pyx_t_2);
21162 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21165 __Pyx_XGIVEREF(__pyx_r);
21166 __Pyx_TraceReturn(__pyx_r, 0);
21167 __Pyx_RefNannyFinishContext();
21179 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
21180 PyObject *__pyx_r = NULL;
21181 __Pyx_TraceDeclarations
21182 __Pyx_RefNannyDeclarations
21185 PyObject *__pyx_t_3 = NULL;
21186 int __pyx_lineno = 0;
21187 const char *__pyx_filename = NULL;
21188 int __pyx_clineno = 0;
21189 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
21190 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error));
21199 __Pyx_TraceLine(986,0,__PYX_ERR(1, 986, __pyx_L1_error))
21200 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
21210 __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
21211 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
21230 __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
21232 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
21233 __Pyx_GOTREF(__pyx_t_3);
21234 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21247 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21250 __Pyx_XDECREF(__pyx_t_3);
21251 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21254 __Pyx_XGIVEREF(__pyx_r);
21255 __Pyx_TraceReturn(__pyx_r, 0);
21256 __Pyx_RefNannyFinishContext();
21269 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
21270 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
21271 PyObject *__pyx_r = 0;
21272 __Pyx_RefNannyDeclarations
21273 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
21274 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21277 __Pyx_RefNannyFinishContext();
21281 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21282 PyObject *__pyx_r = NULL;
21283 __Pyx_TraceDeclarations
21284 __Pyx_RefNannyDeclarations
21285 int __pyx_lineno = 0;
21286 const char *__pyx_filename = NULL;
21287 int __pyx_clineno = 0;
21288 __Pyx_RefNannySetupContext(
"__get__", 0);
21289 __Pyx_TraceCall(
"__get__", __pyx_f[1], 992, 0, __PYX_ERR(1, 992, __pyx_L1_error));
21298 __Pyx_TraceLine(993,0,__PYX_ERR(1, 993, __pyx_L1_error))
21299 __Pyx_XDECREF(__pyx_r);
21300 __Pyx_INCREF(__pyx_v_self->from_object);
21301 __pyx_r = __pyx_v_self->from_object;
21314 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21317 __Pyx_XGIVEREF(__pyx_r);
21318 __Pyx_TraceReturn(__pyx_r, 0);
21319 __Pyx_RefNannyFinishContext();
21330 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
21331 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
21332 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
21333 PyObject *__pyx_r = 0;
21334 __Pyx_RefNannyDeclarations
21335 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
21336 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21339 __Pyx_RefNannyFinishContext();
21343 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21344 PyObject *__pyx_r = NULL;
21345 __Pyx_TraceDeclarations
21346 __Pyx_RefNannyDeclarations
21347 PyObject *__pyx_t_1 = NULL;
21348 int __pyx_lineno = 0;
21349 const char *__pyx_filename = NULL;
21350 int __pyx_clineno = 0;
21351 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
21352 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
21360 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
21361 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
21362 __Pyx_GOTREF(__pyx_t_1);
21363 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
21364 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21365 __PYX_ERR(1, 2, __pyx_L1_error)
21375 __Pyx_XDECREF(__pyx_t_1);
21376 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21378 __Pyx_XGIVEREF(__pyx_r);
21379 __Pyx_TraceReturn(__pyx_r, 0);
21380 __Pyx_RefNannyFinishContext();
21392 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
21393 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
21394 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
21395 PyObject *__pyx_r = 0;
21396 __Pyx_RefNannyDeclarations
21397 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
21398 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
21401 __Pyx_RefNannyFinishContext();
21405 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
21406 PyObject *__pyx_r = NULL;
21407 __Pyx_TraceDeclarations
21408 __Pyx_RefNannyDeclarations
21409 PyObject *__pyx_t_1 = NULL;
21410 int __pyx_lineno = 0;
21411 const char *__pyx_filename = NULL;
21412 int __pyx_clineno = 0;
21413 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
21414 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
21421 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
21422 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
21423 __Pyx_GOTREF(__pyx_t_1);
21424 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
21425 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21426 __PYX_ERR(1, 4, __pyx_L1_error)
21437 __Pyx_XDECREF(__pyx_t_1);
21438 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21440 __Pyx_XGIVEREF(__pyx_r);
21441 __Pyx_TraceReturn(__pyx_r, 0);
21442 __Pyx_RefNannyFinishContext();
21454 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
21455 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
21456 Py_ssize_t __pyx_v_suboffset;
21457 PyObject *__pyx_v_length = NULL;
21458 PyObject *__pyx_r = NULL;
21459 __Pyx_TraceDeclarations
21460 __Pyx_RefNannyDeclarations
21462 PyObject *__pyx_t_2 = NULL;
21463 PyObject *__pyx_t_3 = NULL;
21464 __Pyx_TypeInfo *__pyx_t_4;
21465 Py_buffer __pyx_t_5;
21466 Py_ssize_t *__pyx_t_6;
21467 Py_ssize_t *__pyx_t_7;
21468 Py_ssize_t *__pyx_t_8;
21469 Py_ssize_t __pyx_t_9;
21470 int __pyx_lineno = 0;
21471 const char *__pyx_filename = NULL;
21472 int __pyx_clineno = 0;
21473 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
21474 __Pyx_TraceCall(
"memoryview_fromslice", __pyx_f[1], 999, 0, __PYX_ERR(1, 999, __pyx_L1_error));
21483 __Pyx_TraceLine(1007,0,__PYX_ERR(1, 1007, __pyx_L1_error))
21484 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
21494 __Pyx_TraceLine(1008,0,__PYX_ERR(1, 1008, __pyx_L1_error))
21495 __Pyx_XDECREF(__pyx_r);
21496 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21515 __Pyx_TraceLine(1013,0,__PYX_ERR(1, 1013, __pyx_L1_error))
21516 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
21517 __Pyx_GOTREF(__pyx_t_2);
21518 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
21519 __Pyx_GOTREF(__pyx_t_3);
21520 __Pyx_INCREF(Py_None);
21521 __Pyx_GIVEREF(Py_None);
21522 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
21523 __Pyx_INCREF(__pyx_int_0);
21524 __Pyx_GIVEREF(__pyx_int_0);
21525 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
21526 __Pyx_GIVEREF(__pyx_t_2);
21527 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
21529 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
21530 __Pyx_GOTREF(__pyx_t_2);
21531 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21532 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
21542 __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
21543 __pyx_v_result->from_slice = __pyx_v_memviewslice;
21552 __Pyx_TraceLine(1016,0,__PYX_ERR(1, 1016, __pyx_L1_error))
21553 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
21562 __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
21563 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
21564 __Pyx_GOTREF(__pyx_t_2);
21565 __Pyx_GIVEREF(__pyx_t_2);
21566 __Pyx_GOTREF(__pyx_v_result->from_object);
21567 __Pyx_DECREF(__pyx_v_result->from_object);
21568 __pyx_v_result->from_object = __pyx_t_2;
21578 __Pyx_TraceLine(1019,0,__PYX_ERR(1, 1019, __pyx_L1_error))
21579 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
21580 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
21589 __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
21590 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
21591 __pyx_v_result->__pyx_base.view = __pyx_t_5;
21600 __Pyx_TraceLine(1022,0,__PYX_ERR(1, 1022, __pyx_L1_error))
21601 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
21610 __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
21611 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
21620 __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
21621 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
21630 __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
21631 Py_INCREF(Py_None);
21640 __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
21641 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
21651 __Pyx_TraceLine(1028,0,__PYX_ERR(1, 1028, __pyx_L1_error))
21652 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
21671 __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
21673 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
21684 __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
21685 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
21694 __Pyx_TraceLine(1033,0,__PYX_ERR(1, 1033, __pyx_L1_error))
21695 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
21704 __Pyx_TraceLine(1036,0,__PYX_ERR(1, 1036, __pyx_L1_error))
21705 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
21714 __Pyx_TraceLine(1037,0,__PYX_ERR(1, 1037, __pyx_L1_error))
21715 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
21716 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
21717 __pyx_t_6 = __pyx_t_8;
21718 __pyx_v_suboffset = (__pyx_t_6[0]);
21727 __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
21728 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
21738 __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
21739 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
21748 __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
21749 goto __pyx_L6_break;
21769 __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
21770 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
21771 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
21780 __Pyx_TraceLine(1043,0,__PYX_ERR(1, 1043, __pyx_L1_error))
21781 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
21782 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
21783 __pyx_t_6 = __pyx_t_8;
21784 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
21785 __Pyx_GOTREF(__pyx_t_2);
21786 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
21796 __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
21797 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
21798 __Pyx_GOTREF(__pyx_t_2);
21799 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
21800 __Pyx_GOTREF(__pyx_t_3);
21801 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21802 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
21803 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21804 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
21814 __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
21815 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
21824 __Pyx_TraceLine(1047,0,__PYX_ERR(1, 1047, __pyx_L1_error))
21825 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
21834 __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
21835 __Pyx_XDECREF(__pyx_r);
21836 __Pyx_INCREF(((PyObject *)__pyx_v_result));
21837 __pyx_r = ((PyObject *)__pyx_v_result);
21850 __Pyx_XDECREF(__pyx_t_2);
21851 __Pyx_XDECREF(__pyx_t_3);
21852 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
21855 __Pyx_XDECREF((PyObject *)__pyx_v_result);
21856 __Pyx_XDECREF(__pyx_v_length);
21857 __Pyx_XGIVEREF(__pyx_r);
21858 __Pyx_TraceReturn(__pyx_r, 0);
21859 __Pyx_RefNannyFinishContext();
21871 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
21872 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
21873 __Pyx_memviewslice *__pyx_r;
21874 __Pyx_TraceDeclarations
21875 __Pyx_RefNannyDeclarations
21878 PyObject *__pyx_t_3 = NULL;
21879 int __pyx_lineno = 0;
21880 const char *__pyx_filename = NULL;
21881 int __pyx_clineno = 0;
21882 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
21883 __Pyx_TraceCall(
"get_slice_from_memview", __pyx_f[1], 1052, 0, __PYX_ERR(1, 1052, __pyx_L1_error));
21892 __Pyx_TraceLine(1055,0,__PYX_ERR(1, 1055, __pyx_L1_error))
21893 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
21894 __pyx_t_2 = (__pyx_t_1 != 0);
21904 __Pyx_TraceLine(1056,0,__PYX_ERR(1, 1056, __pyx_L1_error))
21905 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
21906 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
21907 __Pyx_INCREF(__pyx_t_3);
21908 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
21918 __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
21919 __pyx_r = (&__pyx_v_obj->from_slice);
21938 __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
21940 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
21949 __Pyx_TraceLine(1060,0,__PYX_ERR(1, 1060, __pyx_L1_error))
21950 __pyx_r = __pyx_v_mslice;
21964 __Pyx_XDECREF(__pyx_t_3);
21965 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
21968 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
21969 __Pyx_TraceReturn(Py_None, 0);
21970 __Pyx_RefNannyFinishContext();
21982 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
21984 Py_ssize_t *__pyx_v_shape;
21985 Py_ssize_t *__pyx_v_strides;
21986 Py_ssize_t *__pyx_v_suboffsets;
21987 __Pyx_TraceDeclarations
21988 __Pyx_RefNannyDeclarations
21989 Py_ssize_t *__pyx_t_1;
21993 Py_ssize_t __pyx_t_5;
21994 int __pyx_lineno = 0;
21995 const char *__pyx_filename = NULL;
21996 int __pyx_clineno = 0;
21997 __Pyx_RefNannySetupContext(
"slice_copy", 0);
21998 __Pyx_TraceCall(
"slice_copy", __pyx_f[1], 1063, 0, __PYX_ERR(1, 1063, __pyx_L1_error));
22007 __Pyx_TraceLine(1067,0,__PYX_ERR(1, 1067, __pyx_L1_error))
22008 __pyx_t_1 = __pyx_v_memview->view.shape;
22009 __pyx_v_shape = __pyx_t_1;
22018 __Pyx_TraceLine(1068,0,__PYX_ERR(1, 1068, __pyx_L1_error))
22019 __pyx_t_1 = __pyx_v_memview->view.strides;
22020 __pyx_v_strides = __pyx_t_1;
22029 __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
22030 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
22031 __pyx_v_suboffsets = __pyx_t_1;
22040 __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
22041 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
22050 __Pyx_TraceLine(1072,0,__PYX_ERR(1, 1072, __pyx_L1_error))
22051 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
22060 __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
22061 __pyx_t_2 = __pyx_v_memview->view.ndim;
22062 __pyx_t_3 = __pyx_t_2;
22063 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22064 __pyx_v_dim = __pyx_t_4;
22073 __Pyx_TraceLine(1075,0,__PYX_ERR(1, 1075, __pyx_L1_error))
22074 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
22083 __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
22084 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
22093 __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
22094 if ((__pyx_v_suboffsets != 0)) {
22095 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
22099 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
22113 __Pyx_WriteUnraisable(
"View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
22115 __Pyx_TraceReturn(Py_None, 0);
22116 __Pyx_RefNannyFinishContext();
22127 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
22128 __Pyx_memviewslice __pyx_v_memviewslice;
22129 PyObject *__pyx_r = NULL;
22130 __Pyx_TraceDeclarations
22131 __Pyx_RefNannyDeclarations
22132 PyObject *__pyx_t_1 = NULL;
22133 int __pyx_lineno = 0;
22134 const char *__pyx_filename = NULL;
22135 int __pyx_clineno = 0;
22136 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
22137 __Pyx_TraceCall(
"memoryview_copy", __pyx_f[1], 1080, 0, __PYX_ERR(1, 1080, __pyx_L1_error));
22146 __Pyx_TraceLine(1083,0,__PYX_ERR(1, 1083, __pyx_L1_error))
22147 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
22156 __Pyx_TraceLine(1084,0,__PYX_ERR(1, 1084, __pyx_L1_error))
22157 __Pyx_XDECREF(__pyx_r);
22158 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
22159 __Pyx_GOTREF(__pyx_t_1);
22160 __pyx_r = __pyx_t_1;
22174 __Pyx_XDECREF(__pyx_t_1);
22175 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
22178 __Pyx_XGIVEREF(__pyx_r);
22179 __Pyx_TraceReturn(__pyx_r, 0);
22180 __Pyx_RefNannyFinishContext();
22192 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
22193 PyObject *(*__pyx_v_to_object_func)(
char *);
22194 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
22195 PyObject *__pyx_r = NULL;
22196 __Pyx_TraceDeclarations
22197 __Pyx_RefNannyDeclarations
22200 PyObject *(*__pyx_t_3)(
char *);
22201 int (*__pyx_t_4)(
char *, PyObject *);
22202 PyObject *__pyx_t_5 = NULL;
22203 int __pyx_lineno = 0;
22204 const char *__pyx_filename = NULL;
22205 int __pyx_clineno = 0;
22206 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
22207 __Pyx_TraceCall(
"memoryview_copy_from_slice", __pyx_f[1], 1087, 0, __PYX_ERR(1, 1087, __pyx_L1_error));
22216 __Pyx_TraceLine(1094,0,__PYX_ERR(1, 1094, __pyx_L1_error))
22217 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
22218 __pyx_t_2 = (__pyx_t_1 != 0);
22228 __Pyx_TraceLine(1095,0,__PYX_ERR(1, 1095, __pyx_L1_error))
22229 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
22230 __pyx_v_to_object_func = __pyx_t_3;
22239 __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
22240 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
22241 __pyx_v_to_dtype_func = __pyx_t_4;
22260 __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
22262 __pyx_v_to_object_func = NULL;
22271 __Pyx_TraceLine(1099,0,__PYX_ERR(1, 1099, __pyx_L1_error))
22272 __pyx_v_to_dtype_func = NULL;
22283 __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
22284 __Pyx_XDECREF(__pyx_r);
22293 __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
22294 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
22295 __Pyx_GOTREF(__pyx_t_5);
22296 __pyx_r = __pyx_t_5;
22310 __Pyx_XDECREF(__pyx_t_5);
22311 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
22314 __Pyx_XGIVEREF(__pyx_r);
22315 __Pyx_TraceReturn(__pyx_r, 0);
22316 __Pyx_RefNannyFinishContext();
22328 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
22329 Py_ssize_t __pyx_r;
22330 __Pyx_TraceDeclarations
22332 int __pyx_lineno = 0;
22333 const char *__pyx_filename = NULL;
22334 int __pyx_clineno = 0;
22335 __Pyx_TraceCall(
"abs_py_ssize_t", __pyx_f[1], 1109, 1, __PYX_ERR(1, 1109, __pyx_L1_error));
22344 __Pyx_TraceLine(1110,1,__PYX_ERR(1, 1110, __pyx_L1_error))
22345 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
22355 __Pyx_TraceLine(1111,1,__PYX_ERR(1, 1111, __pyx_L1_error))
22356 __pyx_r = (-__pyx_v_arg);
22375 __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
22377 __pyx_r = __pyx_v_arg;
22391 __Pyx_WriteUnraisable(
"View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
22394 __Pyx_TraceReturn(Py_None, 1);
22406 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
22408 Py_ssize_t __pyx_v_c_stride;
22409 Py_ssize_t __pyx_v_f_stride;
22411 __Pyx_TraceDeclarations
22416 int __pyx_lineno = 0;
22417 const char *__pyx_filename = NULL;
22418 int __pyx_clineno = 0;
22419 __Pyx_TraceCall(
"get_best_order", __pyx_f[1], 1116, 1, __PYX_ERR(1, 1116, __pyx_L1_error));
22428 __Pyx_TraceLine(1121,1,__PYX_ERR(1, 1121, __pyx_L1_error))
22429 __pyx_v_c_stride = 0;
22438 __Pyx_TraceLine(1122,1,__PYX_ERR(1, 1122, __pyx_L1_error))
22439 __pyx_v_f_stride = 0;
22448 __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
22449 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
22450 __pyx_v_i = __pyx_t_1;
22459 __Pyx_TraceLine(1125,1,__PYX_ERR(1, 1125, __pyx_L1_error))
22460 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
22470 __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
22471 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
22480 __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
22481 goto __pyx_L4_break;
22501 __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
22502 __pyx_t_1 = __pyx_v_ndim;
22503 __pyx_t_3 = __pyx_t_1;
22504 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22505 __pyx_v_i = __pyx_t_4;
22514 __Pyx_TraceLine(1130,1,__PYX_ERR(1, 1130, __pyx_L1_error))
22515 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
22525 __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
22526 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
22535 __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
22536 goto __pyx_L7_break;
22556 __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
22557 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
22567 __Pyx_TraceLine(1135,1,__PYX_ERR(1, 1135, __pyx_L1_error))
22587 __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
22603 __Pyx_WriteUnraisable(
"View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
22606 __Pyx_TraceReturn(Py_None, 1);
22618 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
22619 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
22620 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
22621 Py_ssize_t __pyx_v_dst_extent;
22622 Py_ssize_t __pyx_v_src_stride;
22623 Py_ssize_t __pyx_v_dst_stride;
22627 Py_ssize_t __pyx_t_4;
22628 Py_ssize_t __pyx_t_5;
22629 Py_ssize_t __pyx_t_6;
22638 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
22647 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
22656 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
22665 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
22674 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
22684 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
22687 __pyx_t_1 = __pyx_t_2;
22688 goto __pyx_L5_bool_binop_done;
22690 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
22693 __pyx_t_1 = __pyx_t_2;
22694 goto __pyx_L5_bool_binop_done;
22704 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
22706 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
22708 __pyx_t_3 = (__pyx_t_2 != 0);
22709 __pyx_t_1 = __pyx_t_3;
22710 __pyx_L5_bool_binop_done:;
22728 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
22748 __pyx_t_4 = __pyx_v_dst_extent;
22749 __pyx_t_5 = __pyx_t_4;
22750 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
22751 __pyx_v_i = __pyx_t_6;
22760 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
22769 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
22778 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
22801 __pyx_t_4 = __pyx_v_dst_extent;
22802 __pyx_t_5 = __pyx_t_4;
22803 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
22804 __pyx_v_i = __pyx_t_6;
22813 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
22822 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
22831 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
22855 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
22856 __Pyx_TraceDeclarations
22857 int __pyx_lineno = 0;
22858 const char *__pyx_filename = NULL;
22859 int __pyx_clineno = 0;
22860 __Pyx_TraceCall(
"copy_strided_to_strided", __pyx_f[1], 1170, 1, __PYX_ERR(1, 1170, __pyx_L1_error));
22869 __Pyx_TraceLine(1173,1,__PYX_ERR(1, 1173, __pyx_L1_error))
22870 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
22883 __Pyx_WriteUnraisable(
"View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
22885 __Pyx_TraceReturn(Py_None, 1);
22896 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
22897 Py_ssize_t __pyx_v_shape;
22898 Py_ssize_t __pyx_v_size;
22899 Py_ssize_t __pyx_r;
22900 __Pyx_TraceDeclarations
22901 Py_ssize_t __pyx_t_1;
22902 Py_ssize_t *__pyx_t_2;
22903 Py_ssize_t *__pyx_t_3;
22904 Py_ssize_t *__pyx_t_4;
22905 int __pyx_lineno = 0;
22906 const char *__pyx_filename = NULL;
22907 int __pyx_clineno = 0;
22908 __Pyx_TraceCall(
"slice_get_size", __pyx_f[1], 1177, 1, __PYX_ERR(1, 1177, __pyx_L1_error));
22917 __Pyx_TraceLine(1179,1,__PYX_ERR(1, 1179, __pyx_L1_error))
22918 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
22919 __pyx_v_size = __pyx_t_1;
22928 __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
22929 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
22930 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
22931 __pyx_t_2 = __pyx_t_4;
22932 __pyx_v_shape = (__pyx_t_2[0]);
22941 __Pyx_TraceLine(1182,1,__PYX_ERR(1, 1182, __pyx_L1_error))
22942 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
22952 __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
22953 __pyx_r = __pyx_v_size;
22966 __Pyx_WriteUnraisable(
"View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
22969 __Pyx_TraceReturn(Py_None, 1);
22981 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
22983 Py_ssize_t __pyx_r;
22984 __Pyx_TraceDeclarations
22989 int __pyx_lineno = 0;
22990 const char *__pyx_filename = NULL;
22991 int __pyx_clineno = 0;
22992 __Pyx_TraceCall(
"fill_contig_strides_array", __pyx_f[1], 1187, 1, __PYX_ERR(1, 1187, __pyx_L1_error));
23001 __Pyx_TraceLine(1196,1,__PYX_ERR(1, 1196, __pyx_L1_error))
23002 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
23012 __Pyx_TraceLine(1197,1,__PYX_ERR(1, 1197, __pyx_L1_error))
23013 __pyx_t_2 = __pyx_v_ndim;
23014 __pyx_t_3 = __pyx_t_2;
23015 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23016 __pyx_v_idx = __pyx_t_4;
23025 __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
23026 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
23035 __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
23036 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
23056 __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
23058 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
23059 __pyx_v_idx = __pyx_t_2;
23068 __Pyx_TraceLine(1202,1,__PYX_ERR(1, 1202, __pyx_L1_error))
23069 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
23078 __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
23079 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
23091 __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
23092 __pyx_r = __pyx_v_stride;
23105 __Pyx_WriteUnraisable(
"View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23108 __Pyx_TraceReturn(Py_None, 1);
23120 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
23122 void *__pyx_v_result;
23123 size_t __pyx_v_itemsize;
23124 size_t __pyx_v_size;
23126 __Pyx_TraceDeclarations
23127 Py_ssize_t __pyx_t_1;
23130 struct __pyx_memoryview_obj *__pyx_t_4;
23133 int __pyx_lineno = 0;
23134 const char *__pyx_filename = NULL;
23135 int __pyx_clineno = 0;
23136 __Pyx_TraceCall(
"copy_data_to_temp", __pyx_f[1], 1208, 1, __PYX_ERR(1, 1208, __pyx_L1_error));
23145 __Pyx_TraceLine(1219,1,__PYX_ERR(1, 1219, __pyx_L1_error))
23146 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
23147 __pyx_v_itemsize = __pyx_t_1;
23156 __Pyx_TraceLine(1220,1,__PYX_ERR(1, 1220, __pyx_L1_error))
23157 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
23166 __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
23167 __pyx_v_result = malloc(__pyx_v_size);
23176 __Pyx_TraceLine(1223,1,__PYX_ERR(1, 1223, __pyx_L1_error))
23177 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
23187 __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
23188 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
23206 __Pyx_TraceLine(1227,1,__PYX_ERR(1, 1227, __pyx_L1_error))
23207 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
23216 __Pyx_TraceLine(1228,1,__PYX_ERR(1, 1228, __pyx_L1_error))
23217 __pyx_t_4 = __pyx_v_src->memview;
23218 __pyx_v_tmpslice->memview = __pyx_t_4;
23227 __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
23228 __pyx_t_3 = __pyx_v_ndim;
23229 __pyx_t_5 = __pyx_t_3;
23230 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23231 __pyx_v_i = __pyx_t_6;
23240 __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
23241 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
23250 __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
23251 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
23261 __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
23262 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
23271 __Pyx_TraceLine(1237,1,__PYX_ERR(1, 1237, __pyx_L1_error))
23272 __pyx_t_3 = __pyx_v_ndim;
23273 __pyx_t_5 = __pyx_t_3;
23274 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23275 __pyx_v_i = __pyx_t_6;
23284 __Pyx_TraceLine(1238,1,__PYX_ERR(1, 1238, __pyx_L1_error))
23285 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
23295 __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
23296 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
23315 __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
23316 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
23326 __Pyx_TraceLine(1242,1,__PYX_ERR(1, 1242, __pyx_L1_error))
23327 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
23346 __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
23348 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
23359 __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
23360 __pyx_r = __pyx_v_result;
23375 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23377 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
23379 __Pyx_PyGILState_Release(__pyx_gilstate_save);
23384 __Pyx_TraceReturn(Py_None, 1);
23396 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
23398 __Pyx_TraceDeclarations
23399 __Pyx_RefNannyDeclarations
23400 PyObject *__pyx_t_1 = NULL;
23401 PyObject *__pyx_t_2 = NULL;
23402 PyObject *__pyx_t_3 = NULL;
23403 PyObject *__pyx_t_4 = NULL;
23404 int __pyx_lineno = 0;
23405 const char *__pyx_filename = NULL;
23406 int __pyx_clineno = 0;
23408 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23410 __Pyx_RefNannySetupContext(
"_err_extents", 0);
23411 __Pyx_TraceCall(
"_err_extents", __pyx_f[1], 1251, 0, __PYX_ERR(1, 1251, __pyx_L1_error));
23420 __Pyx_TraceLine(1254,0,__PYX_ERR(1, 1254, __pyx_L1_error))
23421 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
23422 __Pyx_GOTREF(__pyx_t_1);
23423 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
23424 __Pyx_GOTREF(__pyx_t_2);
23425 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
23426 __Pyx_GOTREF(__pyx_t_3);
23427 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
23428 __Pyx_GOTREF(__pyx_t_4);
23429 __Pyx_GIVEREF(__pyx_t_1);
23430 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
23431 __Pyx_GIVEREF(__pyx_t_2);
23432 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
23433 __Pyx_GIVEREF(__pyx_t_3);
23434 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
23446 __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
23447 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
23448 __Pyx_GOTREF(__pyx_t_3);
23449 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23450 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
23451 __Pyx_GOTREF(__pyx_t_4);
23452 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23453 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
23454 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23455 __PYX_ERR(1, 1253, __pyx_L1_error)
23467 __Pyx_XDECREF(__pyx_t_1);
23468 __Pyx_XDECREF(__pyx_t_2);
23469 __Pyx_XDECREF(__pyx_t_3);
23470 __Pyx_XDECREF(__pyx_t_4);
23471 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
23473 __Pyx_TraceReturn(Py_None, 0);
23474 __Pyx_RefNannyFinishContext();
23476 __Pyx_PyGILState_Release(__pyx_gilstate_save);
23489 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
23491 __Pyx_TraceDeclarations
23492 __Pyx_RefNannyDeclarations
23493 PyObject *__pyx_t_1 = NULL;
23494 PyObject *__pyx_t_2 = NULL;
23495 PyObject *__pyx_t_3 = NULL;
23496 PyObject *__pyx_t_4 = NULL;
23497 int __pyx_lineno = 0;
23498 const char *__pyx_filename = NULL;
23499 int __pyx_clineno = 0;
23501 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23503 __Pyx_RefNannySetupContext(
"_err_dim", 0);
23504 __Pyx_TraceCall(
"_err_dim", __pyx_f[1], 1257, 0, __PYX_ERR(1, 1257, __pyx_L1_error));
23505 __Pyx_INCREF(__pyx_v_error);
23514 __Pyx_TraceLine(1258,0,__PYX_ERR(1, 1258, __pyx_L1_error))
23515 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
23516 __Pyx_GOTREF(__pyx_t_2);
23517 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
23518 __Pyx_GOTREF(__pyx_t_3);
23519 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
23520 __Pyx_GOTREF(__pyx_t_4);
23521 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23522 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23523 __Pyx_INCREF(__pyx_v_error);
23524 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
23525 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
23526 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
23527 if (likely(__pyx_t_2)) {
23528 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
23529 __Pyx_INCREF(__pyx_t_2);
23530 __Pyx_INCREF(
function);
23531 __Pyx_DECREF_SET(__pyx_t_3,
function);
23534 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
23535 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23536 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23537 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
23538 __Pyx_GOTREF(__pyx_t_1);
23539 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23540 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
23541 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23542 __PYX_ERR(1, 1258, __pyx_L1_error)
23554 __Pyx_XDECREF(__pyx_t_1);
23555 __Pyx_XDECREF(__pyx_t_2);
23556 __Pyx_XDECREF(__pyx_t_3);
23557 __Pyx_XDECREF(__pyx_t_4);
23558 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
23560 __Pyx_XDECREF(__pyx_v_error);
23561 __Pyx_TraceReturn(Py_None, 0);
23562 __Pyx_RefNannyFinishContext();
23564 __Pyx_PyGILState_Release(__pyx_gilstate_save);
23577 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
23579 __Pyx_TraceDeclarations
23580 __Pyx_RefNannyDeclarations
23582 PyObject *__pyx_t_2 = NULL;
23583 PyObject *__pyx_t_3 = NULL;
23584 PyObject *__pyx_t_4 = NULL;
23585 PyObject *__pyx_t_5 = NULL;
23586 int __pyx_lineno = 0;
23587 const char *__pyx_filename = NULL;
23588 int __pyx_clineno = 0;
23590 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23592 __Pyx_RefNannySetupContext(
"_err", 0);
23593 __Pyx_TraceCall(
"_err", __pyx_f[1], 1261, 0, __PYX_ERR(1, 1261, __pyx_L1_error));
23594 __Pyx_INCREF(__pyx_v_error);
23603 __Pyx_TraceLine(1262,0,__PYX_ERR(1, 1262, __pyx_L1_error))
23604 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
23605 if (unlikely(__pyx_t_1)) {
23614 __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
23615 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
23616 __Pyx_GOTREF(__pyx_t_3);
23617 __Pyx_INCREF(__pyx_v_error);
23618 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
23619 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
23620 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
23621 if (likely(__pyx_t_5)) {
23622 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
23623 __Pyx_INCREF(__pyx_t_5);
23624 __Pyx_INCREF(
function);
23625 __Pyx_DECREF_SET(__pyx_t_4,
function);
23628 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
23629 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
23630 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23631 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
23632 __Pyx_GOTREF(__pyx_t_2);
23633 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23634 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
23635 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23636 __PYX_ERR(1, 1263, __pyx_L1_error)
23654 __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
23656 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
23657 __PYX_ERR(1, 1265, __pyx_L1_error)
23670 __Pyx_XDECREF(__pyx_t_2);
23671 __Pyx_XDECREF(__pyx_t_3);
23672 __Pyx_XDECREF(__pyx_t_4);
23673 __Pyx_XDECREF(__pyx_t_5);
23674 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
23676 __Pyx_XDECREF(__pyx_v_error);
23677 __Pyx_TraceReturn(Py_None, 0);
23678 __Pyx_RefNannyFinishContext();
23680 __Pyx_PyGILState_Release(__pyx_gilstate_save);
23693 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
23694 void *__pyx_v_tmpdata;
23695 size_t __pyx_v_itemsize;
23697 char __pyx_v_order;
23698 int __pyx_v_broadcasting;
23699 int __pyx_v_direct_copy;
23700 __Pyx_memviewslice __pyx_v_tmp;
23703 __Pyx_TraceDeclarations
23704 Py_ssize_t __pyx_t_1;
23712 int __pyx_lineno = 0;
23713 const char *__pyx_filename = NULL;
23714 int __pyx_clineno = 0;
23715 __Pyx_TraceCall(
"memoryview_copy_contents", __pyx_f[1], 1268, 1, __PYX_ERR(1, 1268, __pyx_L1_error));
23724 __Pyx_TraceLine(1276,1,__PYX_ERR(1, 1276, __pyx_L1_error))
23725 __pyx_v_tmpdata = NULL;
23734 __Pyx_TraceLine(1277,1,__PYX_ERR(1, 1277, __pyx_L1_error))
23735 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
23736 __pyx_v_itemsize = __pyx_t_1;
23745 __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
23746 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
23755 __Pyx_TraceLine(1280,1,__PYX_ERR(1, 1280, __pyx_L1_error))
23756 __pyx_v_broadcasting = 0;
23765 __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
23766 __pyx_v_direct_copy = 0;
23775 __Pyx_TraceLine(1284,1,__PYX_ERR(1, 1284, __pyx_L1_error))
23776 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
23786 __Pyx_TraceLine(1285,1,__PYX_ERR(1, 1285, __pyx_L1_error))
23787 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
23806 __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
23807 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
23817 __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
23818 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
23837 __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
23838 __pyx_t_3 = __pyx_v_dst_ndim;
23839 __pyx_t_4 = __pyx_v_src_ndim;
23840 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
23841 __pyx_t_5 = __pyx_t_3;
23843 __pyx_t_5 = __pyx_t_4;
23845 __pyx_v_ndim = __pyx_t_5;
23854 __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
23855 __pyx_t_5 = __pyx_v_ndim;
23856 __pyx_t_3 = __pyx_t_5;
23857 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23858 __pyx_v_i = __pyx_t_4;
23867 __Pyx_TraceLine(1292,1,__PYX_ERR(1, 1292, __pyx_L1_error))
23868 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
23878 __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
23879 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
23889 __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
23890 __pyx_v_broadcasting = 1;
23899 __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
23900 (__pyx_v_src.strides[__pyx_v_i]) = 0;
23919 __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
23921 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
23941 __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
23942 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
23952 __Pyx_TraceLine(1300,1,__PYX_ERR(1, 1300, __pyx_L1_error))
23953 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
23972 __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
23973 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
23983 __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
23984 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
23994 __Pyx_TraceLine(1305,1,__PYX_ERR(1, 1305, __pyx_L1_error))
23995 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
24013 __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
24014 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
24015 __pyx_v_tmpdata = __pyx_t_7;
24024 __Pyx_TraceLine(1308,1,__PYX_ERR(1, 1308, __pyx_L1_error))
24025 __pyx_v_src = __pyx_v_tmp;
24043 __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
24044 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
24054 __Pyx_TraceLine(1313,1,__PYX_ERR(1, 1313, __pyx_L1_error))
24055 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
24065 __Pyx_TraceLine(1314,1,__PYX_ERR(1, 1314, __pyx_L1_error))
24066 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
24085 __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
24086 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
24096 __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
24097 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
24116 __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
24117 __pyx_t_2 = (__pyx_v_direct_copy != 0);
24127 __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
24128 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24137 __Pyx_TraceLine(1321,1,__PYX_ERR(1, 1321, __pyx_L1_error))
24138 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
24147 __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
24148 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24157 __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
24158 free(__pyx_v_tmpdata);
24167 __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
24196 __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
24197 __pyx_t_2 = (__pyx_v_order ==
'F');
24199 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
24201 __pyx_t_8 = (__pyx_t_2 != 0);
24211 __Pyx_TraceLine(1329,1,__PYX_ERR(1, 1329, __pyx_L1_error))
24212 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
24221 __Pyx_TraceLine(1330,1,__PYX_ERR(1, 1330, __pyx_L1_error))
24222 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
24240 __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
24241 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24250 __Pyx_TraceLine(1333,1,__PYX_ERR(1, 1333, __pyx_L1_error))
24251 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
24260 __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
24261 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24270 __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
24271 free(__pyx_v_tmpdata);
24280 __Pyx_TraceLine(1337,1,__PYX_ERR(1, 1337, __pyx_L1_error))
24296 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24298 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
24300 __Pyx_PyGILState_Release(__pyx_gilstate_save);
24305 __Pyx_TraceReturn(Py_None, 1);
24317 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
24319 int __pyx_v_offset;
24320 __Pyx_TraceDeclarations
24324 int __pyx_lineno = 0;
24325 const char *__pyx_filename = NULL;
24326 int __pyx_clineno = 0;
24327 __Pyx_TraceCall(
"broadcast_leading", __pyx_f[1], 1340, 1, __PYX_ERR(1, 1340, __pyx_L1_error));
24336 __Pyx_TraceLine(1344,1,__PYX_ERR(1, 1344, __pyx_L1_error))
24337 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
24346 __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
24347 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
24348 __pyx_v_i = __pyx_t_1;
24357 __Pyx_TraceLine(1347,1,__PYX_ERR(1, 1347, __pyx_L1_error))
24358 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
24367 __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
24368 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
24377 __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
24378 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
24388 __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
24389 __pyx_t_1 = __pyx_v_offset;
24390 __pyx_t_2 = __pyx_t_1;
24391 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24392 __pyx_v_i = __pyx_t_3;
24401 __Pyx_TraceLine(1352,1,__PYX_ERR(1, 1352, __pyx_L1_error))
24402 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
24411 __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
24412 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
24421 __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
24422 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
24436 __Pyx_WriteUnraisable(
"View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24438 __Pyx_TraceReturn(Py_None, 1);
24449 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
24450 __Pyx_TraceDeclarations
24452 int __pyx_lineno = 0;
24453 const char *__pyx_filename = NULL;
24454 int __pyx_clineno = 0;
24455 __Pyx_TraceCall(
"refcount_copying", __pyx_f[1], 1362, 1, __PYX_ERR(1, 1362, __pyx_L1_error));
24464 __Pyx_TraceLine(1366,1,__PYX_ERR(1, 1366, __pyx_L1_error))
24465 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
24475 __Pyx_TraceLine(1367,1,__PYX_ERR(1, 1367, __pyx_L1_error))
24476 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
24498 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24500 __Pyx_TraceReturn(Py_None, 1);
24511 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
24512 __Pyx_TraceDeclarations
24513 __Pyx_RefNannyDeclarations
24514 int __pyx_lineno = 0;
24515 const char *__pyx_filename = NULL;
24516 int __pyx_clineno = 0;
24518 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24520 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
24521 __Pyx_TraceCall(
"refcount_objects_in_slice_with_gil", __pyx_f[1], 1371, 0, __PYX_ERR(1, 1371, __pyx_L1_error));
24530 __Pyx_TraceLine(1374,0,__PYX_ERR(1, 1374, __pyx_L1_error))
24531 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
24544 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
24546 __Pyx_TraceReturn(Py_None, 0);
24547 __Pyx_RefNannyFinishContext();
24549 __Pyx_PyGILState_Release(__pyx_gilstate_save);
24561 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
24562 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
24563 __Pyx_TraceDeclarations
24564 __Pyx_RefNannyDeclarations
24565 Py_ssize_t __pyx_t_1;
24566 Py_ssize_t __pyx_t_2;
24567 Py_ssize_t __pyx_t_3;
24569 int __pyx_lineno = 0;
24570 const char *__pyx_filename = NULL;
24571 int __pyx_clineno = 0;
24572 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
24573 __Pyx_TraceCall(
"refcount_objects_in_slice", __pyx_f[1], 1377, 0, __PYX_ERR(1, 1377, __pyx_L1_error));
24582 __Pyx_TraceLine(1381,0,__PYX_ERR(1, 1381, __pyx_L1_error))
24583 __pyx_t_1 = (__pyx_v_shape[0]);
24584 __pyx_t_2 = __pyx_t_1;
24585 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24586 __pyx_v_i = __pyx_t_3;
24595 __Pyx_TraceLine(1382,0,__PYX_ERR(1, 1382, __pyx_L1_error))
24596 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
24606 __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
24607 __pyx_t_4 = (__pyx_v_inc != 0);
24617 __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
24618 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
24637 __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
24639 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
24660 __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
24670 __Pyx_TraceLine(1389,0,__PYX_ERR(1, 1389, __pyx_L1_error))
24671 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
24682 __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
24683 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
24697 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
24699 __Pyx_TraceReturn(Py_None, 0);
24700 __Pyx_RefNannyFinishContext();
24711 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
24712 __Pyx_TraceDeclarations
24713 int __pyx_lineno = 0;
24714 const char *__pyx_filename = NULL;
24715 int __pyx_clineno = 0;
24716 __Pyx_TraceCall(
"slice_assign_scalar", __pyx_f[1], 1397, 1, __PYX_ERR(1, 1397, __pyx_L1_error));
24725 __Pyx_TraceLine(1400,1,__PYX_ERR(1, 1400, __pyx_L1_error))
24726 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24735 __Pyx_TraceLine(1401,1,__PYX_ERR(1, 1401, __pyx_L1_error))
24736 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
24745 __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
24746 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24759 __Pyx_WriteUnraisable(
"View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24761 __Pyx_TraceReturn(Py_None, 1);
24772 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
24773 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
24774 Py_ssize_t __pyx_v_stride;
24775 Py_ssize_t __pyx_v_extent;
24776 __Pyx_TraceDeclarations
24778 Py_ssize_t __pyx_t_2;
24779 Py_ssize_t __pyx_t_3;
24780 Py_ssize_t __pyx_t_4;
24781 int __pyx_lineno = 0;
24782 const char *__pyx_filename = NULL;
24783 int __pyx_clineno = 0;
24784 __Pyx_TraceCall(
"_slice_assign_scalar", __pyx_f[1], 1407, 1, __PYX_ERR(1, 1407, __pyx_L1_error));
24793 __Pyx_TraceLine(1411,1,__PYX_ERR(1, 1411, __pyx_L1_error))
24794 __pyx_v_stride = (__pyx_v_strides[0]);
24803 __Pyx_TraceLine(1412,1,__PYX_ERR(1, 1412, __pyx_L1_error))
24804 __pyx_v_extent = (__pyx_v_shape[0]);
24813 __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
24814 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
24824 __Pyx_TraceLine(1415,1,__PYX_ERR(1, 1415, __pyx_L1_error))
24825 __pyx_t_2 = __pyx_v_extent;
24826 __pyx_t_3 = __pyx_t_2;
24827 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24828 __pyx_v_i = __pyx_t_4;
24837 __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
24838 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
24847 __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
24848 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
24868 __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
24870 __pyx_t_2 = __pyx_v_extent;
24871 __pyx_t_3 = __pyx_t_2;
24872 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24873 __pyx_v_i = __pyx_t_4;
24882 __Pyx_TraceLine(1420,1,__PYX_ERR(1, 1420, __pyx_L1_error))
24883 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
24892 __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
24893 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
24909 __Pyx_WriteUnraisable(
"View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24911 __Pyx_TraceReturn(Py_None, 1);
24921 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
24922 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
24923 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
24924 PyObject *__pyx_v___pyx_type = 0;
24925 long __pyx_v___pyx_checksum;
24926 PyObject *__pyx_v___pyx_state = 0;
24927 int __pyx_lineno = 0;
24928 const char *__pyx_filename = NULL;
24929 int __pyx_clineno = 0;
24930 PyObject *__pyx_r = 0;
24931 __Pyx_RefNannyDeclarations
24932 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
24934 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
24935 PyObject* values[3] = {0,0,0};
24936 if (unlikely(__pyx_kwds)) {
24937 Py_ssize_t kw_args;
24938 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
24939 switch (pos_args) {
24940 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
24941 CYTHON_FALLTHROUGH;
24942 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
24943 CYTHON_FALLTHROUGH;
24944 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
24945 CYTHON_FALLTHROUGH;
24947 default:
goto __pyx_L5_argtuple_error;
24949 kw_args = PyDict_Size(__pyx_kwds);
24950 switch (pos_args) {
24952 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
24953 else goto __pyx_L5_argtuple_error;
24954 CYTHON_FALLTHROUGH;
24956 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
24958 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
24960 CYTHON_FALLTHROUGH;
24962 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
24964 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
24967 if (unlikely(kw_args > 0)) {
24968 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
24970 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
24971 goto __pyx_L5_argtuple_error;
24973 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
24974 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
24975 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
24977 __pyx_v___pyx_type = values[0];
24978 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
24979 __pyx_v___pyx_state = values[2];
24981 goto __pyx_L4_argument_unpacking_done;
24982 __pyx_L5_argtuple_error:;
24983 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
24985 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
24986 __Pyx_RefNannyFinishContext();
24988 __pyx_L4_argument_unpacking_done:;
24989 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
24992 __Pyx_RefNannyFinishContext();
24996 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
24997 PyObject *__pyx_v___pyx_PickleError = 0;
24998 PyObject *__pyx_v___pyx_result = 0;
24999 PyObject *__pyx_r = NULL;
25000 __Pyx_TraceDeclarations
25001 __Pyx_RefNannyDeclarations
25003 PyObject *__pyx_t_2 = NULL;
25004 PyObject *__pyx_t_3 = NULL;
25005 PyObject *__pyx_t_4 = NULL;
25006 PyObject *__pyx_t_5 = NULL;
25008 int __pyx_lineno = 0;
25009 const char *__pyx_filename = NULL;
25010 int __pyx_clineno = 0;
25011 __Pyx_TraceFrameInit(__pyx_codeobj__40)
25012 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
25013 __Pyx_TraceCall(
"__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
25022 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
25023 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
25033 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
25034 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
25035 __Pyx_GOTREF(__pyx_t_2);
25036 __Pyx_INCREF(__pyx_n_s_PickleError);
25037 __Pyx_GIVEREF(__pyx_n_s_PickleError);
25038 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
25039 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
25040 __Pyx_GOTREF(__pyx_t_3);
25041 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25042 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
25043 __Pyx_GOTREF(__pyx_t_2);
25044 __Pyx_INCREF(__pyx_t_2);
25045 __pyx_v___pyx_PickleError = __pyx_t_2;
25046 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25047 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25056 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
25057 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
25058 __Pyx_GOTREF(__pyx_t_2);
25059 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
25060 __Pyx_GOTREF(__pyx_t_4);
25061 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25062 __Pyx_INCREF(__pyx_v___pyx_PickleError);
25063 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
25064 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
25065 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
25066 if (likely(__pyx_t_5)) {
25067 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
25068 __Pyx_INCREF(__pyx_t_5);
25069 __Pyx_INCREF(
function);
25070 __Pyx_DECREF_SET(__pyx_t_2,
function);
25073 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
25074 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25075 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25076 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
25077 __Pyx_GOTREF(__pyx_t_3);
25078 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25079 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
25080 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25081 __PYX_ERR(1, 6, __pyx_L1_error)
25099 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
25100 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
25101 __Pyx_GOTREF(__pyx_t_2);
25103 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
25104 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
25105 if (likely(__pyx_t_4)) {
25106 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
25107 __Pyx_INCREF(__pyx_t_4);
25108 __Pyx_INCREF(
function);
25109 __Pyx_DECREF_SET(__pyx_t_2,
function);
25112 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
25113 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25114 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
25115 __Pyx_GOTREF(__pyx_t_3);
25116 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25117 __pyx_v___pyx_result = __pyx_t_3;
25127 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
25128 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
25129 __pyx_t_6 = (__pyx_t_1 != 0);
25139 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
25140 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
25141 __pyx_t_3 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
25142 __Pyx_GOTREF(__pyx_t_3);
25143 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25161 __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
25162 __Pyx_XDECREF(__pyx_r);
25163 __Pyx_INCREF(__pyx_v___pyx_result);
25164 __pyx_r = __pyx_v___pyx_result;
25175 __Pyx_XDECREF(__pyx_t_2);
25176 __Pyx_XDECREF(__pyx_t_3);
25177 __Pyx_XDECREF(__pyx_t_4);
25178 __Pyx_XDECREF(__pyx_t_5);
25179 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
25182 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
25183 __Pyx_XDECREF(__pyx_v___pyx_result);
25184 __Pyx_XGIVEREF(__pyx_r);
25185 __Pyx_TraceReturn(__pyx_r, 0);
25186 __Pyx_RefNannyFinishContext();
25198 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
25199 PyObject *__pyx_r = NULL;
25200 __Pyx_TraceDeclarations
25201 __Pyx_RefNannyDeclarations
25202 PyObject *__pyx_t_1 = NULL;
25204 Py_ssize_t __pyx_t_3;
25207 PyObject *__pyx_t_6 = NULL;
25208 PyObject *__pyx_t_7 = NULL;
25209 PyObject *__pyx_t_8 = NULL;
25210 int __pyx_lineno = 0;
25211 const char *__pyx_filename = NULL;
25212 int __pyx_clineno = 0;
25213 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
25214 __Pyx_TraceCall(
"__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
25223 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
25224 if (unlikely(__pyx_v___pyx_state == Py_None)) {
25225 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
25226 __PYX_ERR(1, 12, __pyx_L1_error)
25228 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
25229 __Pyx_GOTREF(__pyx_t_1);
25230 __Pyx_GIVEREF(__pyx_t_1);
25231 __Pyx_GOTREF(__pyx_v___pyx_result->name);
25232 __Pyx_DECREF(__pyx_v___pyx_result->name);
25233 __pyx_v___pyx_result->name = __pyx_t_1;
25242 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
25243 if (unlikely(__pyx_v___pyx_state == Py_None)) {
25244 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
25245 __PYX_ERR(1, 13, __pyx_L1_error)
25247 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
25248 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
25251 __pyx_t_2 = __pyx_t_4;
25252 goto __pyx_L4_bool_binop_done;
25254 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
25255 __pyx_t_5 = (__pyx_t_4 != 0);
25256 __pyx_t_2 = __pyx_t_5;
25257 __pyx_L4_bool_binop_done:;
25265 __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
25266 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
25267 __Pyx_GOTREF(__pyx_t_6);
25268 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
25269 __Pyx_GOTREF(__pyx_t_7);
25270 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25271 if (unlikely(__pyx_v___pyx_state == Py_None)) {
25272 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
25273 __PYX_ERR(1, 14, __pyx_L1_error)
25275 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
25276 __Pyx_GOTREF(__pyx_t_6);
25278 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
25279 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
25280 if (likely(__pyx_t_8)) {
25281 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
25282 __Pyx_INCREF(__pyx_t_8);
25283 __Pyx_INCREF(
function);
25284 __Pyx_DECREF_SET(__pyx_t_7,
function);
25287 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
25288 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
25289 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25290 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
25291 __Pyx_GOTREF(__pyx_t_1);
25292 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25293 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25312 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25315 __Pyx_XDECREF(__pyx_t_1);
25316 __Pyx_XDECREF(__pyx_t_6);
25317 __Pyx_XDECREF(__pyx_t_7);
25318 __Pyx_XDECREF(__pyx_t_8);
25319 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
25322 __Pyx_XGIVEREF(__pyx_r);
25323 __Pyx_TraceReturn(__pyx_r, 0);
25324 __Pyx_RefNannyFinishContext();
25327 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction __pyx_vtable_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
25329 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyTypeObject *t, PyObject *a, PyObject *k) {
25330 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p;
25331 PyObject *o = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_new(t, a, k);
25332 if (unlikely(!o))
return 0;
25333 p = ((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o);
25334 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
25335 p->A_csr = Py_None; Py_INCREF(Py_None);
25336 p->B_csr = Py_None; Py_INCREF(Py_None);
25337 p->A_indices_copy = Py_None; Py_INCREF(Py_None);
25338 p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25339 p->B_indices_copy = Py_None; Py_INCREF(Py_None);
25340 p->B_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25341 if (unlikely(__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_1__cinit__(o, a, k) < 0))
goto bad;
25344 Py_DECREF(o); o = 0;
25348 static void __pyx_tp_dealloc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyObject *o) {
25349 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p = (
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o;
25350 #if CYTHON_USE_TP_FINALIZE
25351 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
25352 if (PyObject_CallFinalizerFromDealloc(o))
return;
25355 PyObject_GC_UnTrack(o);
25356 Py_CLEAR(p->A_csr);
25357 Py_CLEAR(p->B_csr);
25358 Py_CLEAR(p->A_indices_copy);
25359 Py_CLEAR(p->A_index_pointer_copy);
25360 Py_CLEAR(p->B_indices_copy);
25361 Py_CLEAR(p->B_index_pointer_copy);
25362 PyObject_GC_Track(o);
25363 if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dealloc(o);
else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
25366 static int __pyx_tp_traverse_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyObject *o, visitproc v,
void *a) {
25368 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p = (
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o;
25369 e = ((likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) ? ((__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse) ? __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction));
if (e)
return e;
25371 e = (*v)(p->A_csr, a);
if (e)
return e;
25374 e = (*v)(p->B_csr, a);
if (e)
return e;
25376 if (p->A_indices_copy) {
25377 e = (*v)(p->A_indices_copy, a);
if (e)
return e;
25379 if (p->A_index_pointer_copy) {
25380 e = (*v)(p->A_index_pointer_copy, a);
if (e)
return e;
25382 if (p->B_indices_copy) {
25383 e = (*v)(p->B_indices_copy, a);
if (e)
return e;
25385 if (p->B_index_pointer_copy) {
25386 e = (*v)(p->B_index_pointer_copy, a);
if (e)
return e;
25391 static int __pyx_tp_clear_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyObject *o) {
25393 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p = (
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o;
25394 if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) {
if (__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear(o); }
else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
25395 tmp = ((PyObject*)p->A_csr);
25396 p->A_csr = Py_None; Py_INCREF(Py_None);
25398 tmp = ((PyObject*)p->B_csr);
25399 p->B_csr = Py_None; Py_INCREF(Py_None);
25401 tmp = ((PyObject*)p->A_indices_copy);
25402 p->A_indices_copy = Py_None; Py_INCREF(Py_None);
25404 tmp = ((PyObject*)p->A_index_pointer_copy);
25405 p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25407 tmp = ((PyObject*)p->B_indices_copy);
25408 p->B_indices_copy = Py_None; Py_INCREF(Py_None);
25410 tmp = ((PyObject*)p->B_index_pointer_copy);
25411 p->B_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25416 static PyMethodDef __pyx_methods_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction[] = {
25417 {
"set_dense_matrix_float", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float},
25418 {
"set_dense_matrix_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double},
25419 {
"set_dense_matrix_long_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double},
25420 {
"set_csr_matrix_float", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float},
25421 {
"set_csr_matrix_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double},
25422 {
"set_csr_matrix_long_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double},
25423 {
"set_csc_matrix_float", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float},
25424 {
"set_csc_matrix_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double},
25425 {
"set_csc_matrix_long_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double},
25426 {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__},
25427 {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__},
25431 static PyTypeObject __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = {
25432 PyVarObject_HEAD_INIT(0, 0)
25433 "imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction",
25434 sizeof(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction),
25436 __pyx_tp_dealloc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction,
25437 #
if PY_VERSION_HEX < 0x030800b4
25440 #
if PY_VERSION_HEX >= 0x030800b4
25445 #
if PY_MAJOR_VERSION < 3
25448 #
if PY_MAJOR_VERSION >= 3
25461 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
25462 "\n Defines a linear operator that is an affine function of a single parameter.\n Given two matrices :math:`\\mathbf{A}` and :math:`\\mathf{B}`, the linear\n operator is defined by\n\n .. math::\n\n \\mathbf{A}(t) = \\mathbf{A} + t \\mathbf{B},\n\n where :math:`t \\in \\mathbb{R}` is a parameter.\n\n **Initializing Object:**\n\n The matrices :math:`\\mathbf{A}` and :math:`\\mathbf{B}` are given at the\n initialization of the object. These matrices can be a dense matrix as 2D\n numpy arrays, or sparse matrices of any format (CSR, CSC, etc) using scipy\n sparse module.\n\n .. note::\n\n Initializing the linear operator requires python's GIL. Also, the\n following examples should be used in a ``*.pyx`` file and should be\n compiled as cython's extension module.\n\n In the following example, we create the object ``Aop`` based on\n scipy.sparse matrices of CSR format. Note the format of the input matrices\n can also be anything other than ``'csr'``, such as ``'csc'``.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import scipy.sparse\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = scipy.sparse.random(n, m, format='csr')\n >>> B = scipy.sparse.random(n, m, format='csr')\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport AffineMatrixFunction\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, B)\n\n\n The following is an example of defining the operator with dense matrices:\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import numpy\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = numpy.random.randn((n, m), dtype=float)\n >>> B = numpy.random.randn((n, m), dtype=float)\n\n >>> # Create linear operator object\n >>> from imate.linear_operator ""cimport AffineMatrixFunction\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, B)\n\n If the matrix ``B`` is not given, or if it is ``None``, or if it is ``0``,\n then the linear operator assumes ``B`` is zero matrix. For example:\n\n .. code-block:: python\n\n # Case 1: Not providing B\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A)\n\n # Case 2: Setting B to None\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, None)\n\n # Case 3: Setting B to scalar zero\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, 0)\n\n If the matrix ``B`` is set to the scalar ``1``, the linear operator assumes\n that ``B`` is the identity matrix. For example:\n\n .. code-block:: python\n\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, 1)\n\n **Setting the Parameter:**\n\n The parameter :math:`t` is given to the object ``Aop`` at **runtime** using\n :func:`set_parameters` function.\n\n .. note::\n\n Setting the parameter using :func:`set_parameter` does not require\n python's GIL, hence, the parameter can be set in ``nogil`` environment,\n if desired.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> cdef double t = 1.0\n\n >>> # nogil environment is optional\n >>> with nogil:\n ... Aop.set_parameters(&t)\n\n Note that a *pointer* to the parameter should be provided to the function.\n\n **Matrix-Vector Multiplications:**\n\n The linear operator can perform matrix vector multiplication using\n :func:`dot` function and the matrix-vector multiplication with the\n transposed matrix using :func:`transpose_dot` function.\n\n .. note::\n\n Matrix-vector multiplication using :func:`dot` and\n :func:`transpose_dot` functions do not require python's GIL, hence,\n they can be called in a ``nogil`` environment, if desired.\n""\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> # Create a vectors as cython's memoryview to numpy arrays\n >>> import numpy\n >>> cdef double[:] b = numpy.random.randn(m)\n >>> cdef double[:] c = numpy.empty((n, 1), dtype=float)\n\n >>> # Perform product on vector b and store the product on vector c\n >>> with nogil:\n ... Aop.dot(&b[0], &c[0])\n\n >>> # Perform product using the transpose of the operator\n >>> with nogil:\n >>> Aop.transpose_dot(&b[0], &c[0])\n\n .. seealso::\n\n :class:`Matrix`\n ",
25463 __pyx_tp_traverse_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction,
25464 __pyx_tp_clear_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction,
25469 __pyx_methods_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction,
25479 __pyx_tp_new_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction,
25489 #
if PY_VERSION_HEX >= 0x030400a1
25492 #
if PY_VERSION_HEX >= 0x030800b1
25495 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25499 static struct __pyx_vtabstruct_array __pyx_vtable_array;
25501 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
25502 struct __pyx_array_obj *p;
25504 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
25505 o = (*t->tp_alloc)(t, 0);
25507 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25509 if (unlikely(!o))
return 0;
25510 p = ((
struct __pyx_array_obj *)o);
25511 p->__pyx_vtab = __pyx_vtabptr_array;
25512 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
25513 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
25514 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
25517 Py_DECREF(o); o = 0;
25521 static void __pyx_tp_dealloc_array(PyObject *o) {
25522 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
25523 #if CYTHON_USE_TP_FINALIZE
25524 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
25525 if (PyObject_CallFinalizerFromDealloc(o))
return;
25529 PyObject *etype, *eval, *etb;
25530 PyErr_Fetch(&etype, &eval, &etb);
25531 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25532 __pyx_array___dealloc__(o);
25533 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25534 PyErr_Restore(etype, eval, etb);
25537 Py_CLEAR(p->_format);
25538 (*Py_TYPE(o)->tp_free)(o);
25540 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
25542 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
25543 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25548 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
25550 return __pyx_array___setitem__(o, i, v);
25553 PyErr_Format(PyExc_NotImplementedError,
25554 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
25559 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
25560 PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
25561 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25563 v = __pyx_array___getattr__(o, n);
25568 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
25569 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
25572 static PyMethodDef __pyx_methods_array[] = {
25573 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
25574 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
25575 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
25579 static struct PyGetSetDef __pyx_getsets_array[] = {
25580 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
25584 static PySequenceMethods __pyx_tp_as_sequence_array = {
25585 __pyx_array___len__,
25588 __pyx_sq_item_array,
25597 static PyMappingMethods __pyx_tp_as_mapping_array = {
25598 __pyx_array___len__,
25599 __pyx_array___getitem__,
25600 __pyx_mp_ass_subscript_array,
25603 static PyBufferProcs __pyx_tp_as_buffer_array = {
25604 #if PY_MAJOR_VERSION < 3
25607 #if PY_MAJOR_VERSION < 3
25610 #if PY_MAJOR_VERSION < 3
25613 #if PY_MAJOR_VERSION < 3
25616 __pyx_array_getbuffer,
25620 static PyTypeObject __pyx_type___pyx_array = {
25621 PyVarObject_HEAD_INIT(0, 0)
25622 "imate._c_linear_operator.py_c_affine_matrix_function.array",
25623 sizeof(
struct __pyx_array_obj),
25625 __pyx_tp_dealloc_array,
25626 #
if PY_VERSION_HEX < 0x030800b4
25629 #
if PY_VERSION_HEX >= 0x030800b4
25634 #
if PY_MAJOR_VERSION < 3
25637 #
if PY_MAJOR_VERSION >= 3
25642 &__pyx_tp_as_sequence_array,
25643 &__pyx_tp_as_mapping_array,
25647 __pyx_tp_getattro_array,
25649 &__pyx_tp_as_buffer_array,
25650 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
25658 __pyx_methods_array,
25660 __pyx_getsets_array,
25668 __pyx_tp_new_array,
25678 #
if PY_VERSION_HEX >= 0x030400a1
25681 #
if PY_VERSION_HEX >= 0x030800b1
25684 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25689 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
25690 struct __pyx_MemviewEnum_obj *p;
25692 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
25693 o = (*t->tp_alloc)(t, 0);
25695 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25697 if (unlikely(!o))
return 0;
25698 p = ((
struct __pyx_MemviewEnum_obj *)o);
25699 p->name = Py_None; Py_INCREF(Py_None);
25703 static void __pyx_tp_dealloc_Enum(PyObject *o) {
25704 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
25705 #if CYTHON_USE_TP_FINALIZE
25706 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
25707 if (PyObject_CallFinalizerFromDealloc(o))
return;
25710 PyObject_GC_UnTrack(o);
25712 (*Py_TYPE(o)->tp_free)(o);
25715 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v,
void *a) {
25717 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
25719 e = (*v)(p->name, a);
if (e)
return e;
25724 static int __pyx_tp_clear_Enum(PyObject *o) {
25726 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
25727 tmp = ((PyObject*)p->name);
25728 p->name = Py_None; Py_INCREF(Py_None);
25733 static PyMethodDef __pyx_methods_Enum[] = {
25734 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
25735 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
25739 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
25740 PyVarObject_HEAD_INIT(0, 0)
25741 "imate._c_linear_operator.py_c_affine_matrix_function.Enum",
25742 sizeof(
struct __pyx_MemviewEnum_obj),
25744 __pyx_tp_dealloc_Enum,
25745 #
if PY_VERSION_HEX < 0x030800b4
25748 #
if PY_VERSION_HEX >= 0x030800b4
25753 #
if PY_MAJOR_VERSION < 3
25756 #
if PY_MAJOR_VERSION >= 3
25759 __pyx_MemviewEnum___repr__,
25769 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
25771 __pyx_tp_traverse_Enum,
25772 __pyx_tp_clear_Enum,
25777 __pyx_methods_Enum,
25785 __pyx_MemviewEnum___init__,
25797 #
if PY_VERSION_HEX >= 0x030400a1
25800 #
if PY_VERSION_HEX >= 0x030800b1
25803 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25807 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
25809 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
25810 struct __pyx_memoryview_obj *p;
25812 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
25813 o = (*t->tp_alloc)(t, 0);
25815 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25817 if (unlikely(!o))
return 0;
25818 p = ((
struct __pyx_memoryview_obj *)o);
25819 p->__pyx_vtab = __pyx_vtabptr_memoryview;
25820 p->obj = Py_None; Py_INCREF(Py_None);
25821 p->_size = Py_None; Py_INCREF(Py_None);
25822 p->_array_interface = Py_None; Py_INCREF(Py_None);
25823 p->view.obj = NULL;
25824 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
25827 Py_DECREF(o); o = 0;
25831 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
25832 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
25833 #if CYTHON_USE_TP_FINALIZE
25834 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
25835 if (PyObject_CallFinalizerFromDealloc(o))
return;
25838 PyObject_GC_UnTrack(o);
25840 PyObject *etype, *eval, *etb;
25841 PyErr_Fetch(&etype, &eval, &etb);
25842 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25843 __pyx_memoryview___dealloc__(o);
25844 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25845 PyErr_Restore(etype, eval, etb);
25848 Py_CLEAR(p->_size);
25849 Py_CLEAR(p->_array_interface);
25850 (*Py_TYPE(o)->tp_free)(o);
25853 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v,
void *a) {
25855 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
25857 e = (*v)(p->obj, a);
if (e)
return e;
25860 e = (*v)(p->_size, a);
if (e)
return e;
25862 if (p->_array_interface) {
25863 e = (*v)(p->_array_interface, a);
if (e)
return e;
25866 e = (*v)(p->view.obj, a);
if (e)
return e;
25871 static int __pyx_tp_clear_memoryview(PyObject *o) {
25873 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
25874 tmp = ((PyObject*)p->obj);
25875 p->obj = Py_None; Py_INCREF(Py_None);
25877 tmp = ((PyObject*)p->_size);
25878 p->_size = Py_None; Py_INCREF(Py_None);
25880 tmp = ((PyObject*)p->_array_interface);
25881 p->_array_interface = Py_None; Py_INCREF(Py_None);
25883 Py_CLEAR(p->view.obj);
25886 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
25888 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
25889 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25894 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
25896 return __pyx_memoryview___setitem__(o, i, v);
25899 PyErr_Format(PyExc_NotImplementedError,
25900 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
25905 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
25906 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
25909 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
25910 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
25913 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
25914 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
25917 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
25918 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
25921 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
25922 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
25925 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
25926 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
25929 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
25930 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
25933 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
25934 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
25937 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
25938 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
25941 static PyMethodDef __pyx_methods_memoryview[] = {
25942 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
25943 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
25944 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
25945 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
25946 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
25947 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
25951 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
25952 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
25953 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
25954 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
25955 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
25956 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
25957 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
25958 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
25959 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
25960 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
25964 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
25965 __pyx_memoryview___len__,
25968 __pyx_sq_item_memoryview,
25977 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
25978 __pyx_memoryview___len__,
25979 __pyx_memoryview___getitem__,
25980 __pyx_mp_ass_subscript_memoryview,
25983 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
25984 #if PY_MAJOR_VERSION < 3
25987 #if PY_MAJOR_VERSION < 3
25990 #if PY_MAJOR_VERSION < 3
25993 #if PY_MAJOR_VERSION < 3
25996 __pyx_memoryview_getbuffer,
26000 static PyTypeObject __pyx_type___pyx_memoryview = {
26001 PyVarObject_HEAD_INIT(0, 0)
26002 "imate._c_linear_operator.py_c_affine_matrix_function.memoryview",
26003 sizeof(
struct __pyx_memoryview_obj),
26005 __pyx_tp_dealloc_memoryview,
26006 #
if PY_VERSION_HEX < 0x030800b4
26009 #
if PY_VERSION_HEX >= 0x030800b4
26014 #
if PY_MAJOR_VERSION < 3
26017 #
if PY_MAJOR_VERSION >= 3
26020 __pyx_memoryview___repr__,
26022 &__pyx_tp_as_sequence_memoryview,
26023 &__pyx_tp_as_mapping_memoryview,
26026 __pyx_memoryview___str__,
26029 &__pyx_tp_as_buffer_memoryview,
26030 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26032 __pyx_tp_traverse_memoryview,
26033 __pyx_tp_clear_memoryview,
26038 __pyx_methods_memoryview,
26040 __pyx_getsets_memoryview,
26048 __pyx_tp_new_memoryview,
26058 #
if PY_VERSION_HEX >= 0x030400a1
26061 #
if PY_VERSION_HEX >= 0x030800b1
26064 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26068 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
26070 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
26071 struct __pyx_memoryviewslice_obj *p;
26072 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
26073 if (unlikely(!o))
return 0;
26074 p = ((
struct __pyx_memoryviewslice_obj *)o);
26075 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
26076 p->from_object = Py_None; Py_INCREF(Py_None);
26077 p->from_slice.memview = NULL;
26081 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
26082 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
26083 #if CYTHON_USE_TP_FINALIZE
26084 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
26085 if (PyObject_CallFinalizerFromDealloc(o))
return;
26088 PyObject_GC_UnTrack(o);
26090 PyObject *etype, *eval, *etb;
26091 PyErr_Fetch(&etype, &eval, &etb);
26092 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
26093 __pyx_memoryviewslice___dealloc__(o);
26094 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
26095 PyErr_Restore(etype, eval, etb);
26097 Py_CLEAR(p->from_object);
26098 PyObject_GC_Track(o);
26099 __pyx_tp_dealloc_memoryview(o);
26102 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v,
void *a) {
26104 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
26105 e = __pyx_tp_traverse_memoryview(o, v, a);
if (e)
return e;
26106 if (p->from_object) {
26107 e = (*v)(p->from_object, a);
if (e)
return e;
26112 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
26114 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
26115 __pyx_tp_clear_memoryview(o);
26116 tmp = ((PyObject*)p->from_object);
26117 p->from_object = Py_None; Py_INCREF(Py_None);
26119 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
26123 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
26124 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
26127 static PyMethodDef __pyx_methods__memoryviewslice[] = {
26128 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
26129 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
26133 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
26134 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
26138 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
26139 PyVarObject_HEAD_INIT(0, 0)
26140 "imate._c_linear_operator.py_c_affine_matrix_function._memoryviewslice",
26141 sizeof(
struct __pyx_memoryviewslice_obj),
26143 __pyx_tp_dealloc__memoryviewslice,
26144 #
if PY_VERSION_HEX < 0x030800b4
26147 #
if PY_VERSION_HEX >= 0x030800b4
26152 #
if PY_MAJOR_VERSION < 3
26155 #
if PY_MAJOR_VERSION >= 3
26158 #
if CYTHON_COMPILING_IN_PYPY
26159 __pyx_memoryview___repr__,
26168 #
if CYTHON_COMPILING_IN_PYPY
26169 __pyx_memoryview___str__,
26176 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26177 "Internal class for passing memoryview slices to Python",
26178 __pyx_tp_traverse__memoryviewslice,
26179 __pyx_tp_clear__memoryviewslice,
26184 __pyx_methods__memoryviewslice,
26186 __pyx_getsets__memoryviewslice,
26194 __pyx_tp_new__memoryviewslice,
26204 #
if PY_VERSION_HEX >= 0x030400a1
26207 #
if PY_VERSION_HEX >= 0x030800b1
26210 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26215 static PyMethodDef __pyx_methods[] = {
26219 #if PY_MAJOR_VERSION >= 3
26220 #if CYTHON_PEP489_MULTI_PHASE_INIT
26221 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
26222 static int __pyx_pymod_exec_py_c_affine_matrix_function(PyObject* module);
26223 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
26224 {Py_mod_create, (
void*)__pyx_pymod_create},
26225 {Py_mod_exec, (
void*)__pyx_pymod_exec_py_c_affine_matrix_function},
26230 static struct PyModuleDef __pyx_moduledef = {
26231 PyModuleDef_HEAD_INIT,
26232 "py_c_affine_matrix_function",
26234 #if CYTHON_PEP489_MULTI_PHASE_INIT
26240 #if CYTHON_PEP489_MULTI_PHASE_INIT
26241 __pyx_moduledef_slots,
26250 #ifndef CYTHON_SMALL_CODE
26251 #if defined(__clang__)
26252 #define CYTHON_SMALL_CODE
26253 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
26254 #define CYTHON_SMALL_CODE __attribute__((cold))
26256 #define CYTHON_SMALL_CODE
26260 static __Pyx_StringTabEntry __pyx_string_tab[] = {
26261 {&__pyx_n_s_A, __pyx_k_A,
sizeof(__pyx_k_A), 0, 0, 1, 1},
26262 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
26263 {&__pyx_kp_u_A_and_B_should_have_similar_data, __pyx_k_A_and_B_should_have_similar_data,
sizeof(__pyx_k_A_and_B_should_have_similar_data), 0, 1, 0, 0},
26264 {&__pyx_kp_u_A_and_B_should_have_the_same_sha, __pyx_k_A_and_B_should_have_the_same_sha,
sizeof(__pyx_k_A_and_B_should_have_the_same_sha), 0, 1, 0, 0},
26265 {&__pyx_kp_u_A_cannot_be_None, __pyx_k_A_cannot_be_None,
sizeof(__pyx_k_A_cannot_be_None), 0, 1, 0, 0},
26266 {&__pyx_n_s_A_data, __pyx_k_A_data,
sizeof(__pyx_k_A_data), 0, 0, 1, 1},
26267 {&__pyx_n_s_A_data_mv, __pyx_k_A_data_mv,
sizeof(__pyx_k_A_data_mv), 0, 0, 1, 1},
26268 {&__pyx_n_s_A_data_mv_c, __pyx_k_A_data_mv_c,
sizeof(__pyx_k_A_data_mv_c), 0, 0, 1, 1},
26269 {&__pyx_n_s_A_data_mv_f, __pyx_k_A_data_mv_f,
sizeof(__pyx_k_A_data_mv_f), 0, 0, 1, 1},
26270 {&__pyx_n_s_A_index_pointer, __pyx_k_A_index_pointer,
sizeof(__pyx_k_A_index_pointer), 0, 0, 1, 1},
26271 {&__pyx_n_s_A_index_pointer_mv, __pyx_k_A_index_pointer_mv,
sizeof(__pyx_k_A_index_pointer_mv), 0, 0, 1, 1},
26272 {&__pyx_n_s_A_indices, __pyx_k_A_indices,
sizeof(__pyx_k_A_indices), 0, 0, 1, 1},
26273 {&__pyx_n_s_A_indices_mv, __pyx_k_A_indices_mv,
sizeof(__pyx_k_A_indices_mv), 0, 0, 1, 1},
26274 {&__pyx_n_s_A_is_row_major, __pyx_k_A_is_row_major,
sizeof(__pyx_k_A_is_row_major), 0, 0, 1, 1},
26275 {&__pyx_n_s_A_num_columns, __pyx_k_A_num_columns,
sizeof(__pyx_k_A_num_columns), 0, 0, 1, 1},
26276 {&__pyx_n_s_A_num_rows, __pyx_k_A_num_rows,
sizeof(__pyx_k_A_num_rows), 0, 0, 1, 1},
26277 {&__pyx_n_s_B, __pyx_k_B,
sizeof(__pyx_k_B), 0, 0, 1, 1},
26278 {&__pyx_n_s_B_data, __pyx_k_B_data,
sizeof(__pyx_k_B_data), 0, 0, 1, 1},
26279 {&__pyx_n_s_B_data_mv, __pyx_k_B_data_mv,
sizeof(__pyx_k_B_data_mv), 0, 0, 1, 1},
26280 {&__pyx_n_s_B_data_mv_c, __pyx_k_B_data_mv_c,
sizeof(__pyx_k_B_data_mv_c), 0, 0, 1, 1},
26281 {&__pyx_n_s_B_data_mv_f, __pyx_k_B_data_mv_f,
sizeof(__pyx_k_B_data_mv_f), 0, 0, 1, 1},
26282 {&__pyx_n_s_B_index_pointer, __pyx_k_B_index_pointer,
sizeof(__pyx_k_B_index_pointer), 0, 0, 1, 1},
26283 {&__pyx_n_s_B_index_pointer_mv, __pyx_k_B_index_pointer_mv,
sizeof(__pyx_k_B_index_pointer_mv), 0, 0, 1, 1},
26284 {&__pyx_n_s_B_indices, __pyx_k_B_indices,
sizeof(__pyx_k_B_indices), 0, 0, 1, 1},
26285 {&__pyx_n_s_B_indices_mv, __pyx_k_B_indices_mv,
sizeof(__pyx_k_B_indices_mv), 0, 0, 1, 1},
26286 {&__pyx_n_s_B_is_identity, __pyx_k_B_is_identity,
sizeof(__pyx_k_B_is_identity), 0, 0, 1, 1},
26287 {&__pyx_n_s_B_is_row_major, __pyx_k_B_is_row_major,
sizeof(__pyx_k_B_is_row_major), 0, 0, 1, 1},
26288 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
26289 {&__pyx_n_u_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS,
sizeof(__pyx_k_C_CONTIGUOUS), 0, 1, 0, 1},
26290 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
26291 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
26292 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
26293 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
26294 {&__pyx_kp_u_Data_type_should_be_float32_floa, __pyx_k_Data_type_should_be_float32_floa,
sizeof(__pyx_k_Data_type_should_be_float32_floa), 0, 1, 0, 0},
26295 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
26296 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
26297 {&__pyx_n_u_F_CONTIGUOUS, __pyx_k_F_CONTIGUOUS,
sizeof(__pyx_k_F_CONTIGUOUS), 0, 1, 0, 1},
26298 {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
26299 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
26300 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
26301 {&__pyx_kp_u_Input_matrix_should_be_a_2_dimen, __pyx_k_Input_matrix_should_be_a_2_dimen,
sizeof(__pyx_k_Input_matrix_should_be_a_2_dimen), 0, 1, 0, 0},
26302 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
26303 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
26304 {&__pyx_kp_u_Matrices_A_and_B_should_have_sim, __pyx_k_Matrices_A_and_B_should_have_sim,
sizeof(__pyx_k_Matrices_A_and_B_should_have_sim), 0, 1, 0, 0},
26305 {&__pyx_kp_u_Matrix_A_should_be_either_C_or_F, __pyx_k_Matrix_A_should_be_either_C_or_F,
sizeof(__pyx_k_Matrix_A_should_be_either_C_or_F), 0, 1, 0, 0},
26306 {&__pyx_kp_u_Matrix_B_should_be_either_C_or_F, __pyx_k_Matrix_B_should_be_either_C_or_F,
sizeof(__pyx_k_Matrix_B_should_be_either_C_or_F), 0, 1, 0, 0},
26307 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
26308 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
26309 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
26310 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
26311 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
26312 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
26313 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
26314 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
26315 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
26316 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
26317 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
26318 {&__pyx_n_s_astype, __pyx_k_astype,
sizeof(__pyx_k_astype), 0, 0, 1, 1},
26319 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
26320 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
26321 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
26322 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
26323 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
26324 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
26325 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
26326 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
26327 {&__pyx_n_s_csr_matrix, __pyx_k_csr_matrix,
sizeof(__pyx_k_csr_matrix), 0, 0, 1, 1},
26328 {&__pyx_n_s_data, __pyx_k_data,
sizeof(__pyx_k_data), 0, 0, 1, 1},
26329 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
26330 {&__pyx_n_s_dtype, __pyx_k_dtype,
sizeof(__pyx_k_dtype), 0, 0, 1, 1},
26331 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
26332 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
26333 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
26334 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
26335 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
26336 {&__pyx_n_b_float128, __pyx_k_float128,
sizeof(__pyx_k_float128), 0, 0, 0, 1},
26337 {&__pyx_n_b_float32, __pyx_k_float32,
sizeof(__pyx_k_float32), 0, 0, 0, 1},
26338 {&__pyx_n_b_float64, __pyx_k_float64,
sizeof(__pyx_k_float64), 0, 0, 0, 1},
26339 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
26340 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
26341 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
26342 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
26343 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
26344 {&__pyx_n_s_has_sorted_indices, __pyx_k_has_sorted_indices,
sizeof(__pyx_k_has_sorted_indices), 0, 0, 1, 1},
26345 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
26346 {&__pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_k_imate__c_linear_operator_py_c_af,
sizeof(__pyx_k_imate__c_linear_operator_py_c_af), 0, 0, 1, 0},
26347 {&__pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_k_imate__c_linear_operator_py_c_af_2,
sizeof(__pyx_k_imate__c_linear_operator_py_c_af_2), 0, 0, 1, 1},
26348 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
26349 {&__pyx_n_s_indices, __pyx_k_indices,
sizeof(__pyx_k_indices), 0, 0, 1, 1},
26350 {&__pyx_n_s_indptr, __pyx_k_indptr,
sizeof(__pyx_k_indptr), 0, 0, 1, 1},
26351 {&__pyx_n_s_issparse, __pyx_k_issparse,
sizeof(__pyx_k_issparse), 0, 0, 1, 1},
26352 {&__pyx_n_s_isspmatrix_csc, __pyx_k_isspmatrix_csc,
sizeof(__pyx_k_isspmatrix_csc), 0, 0, 1, 1},
26353 {&__pyx_n_s_isspmatrix_csr, __pyx_k_isspmatrix_csr,
sizeof(__pyx_k_isspmatrix_csr), 0, 0, 1, 1},
26354 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
26355 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
26356 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
26357 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
26358 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
26359 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
26360 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
26361 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
26362 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
26363 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
26364 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
26365 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
26366 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
26367 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
26368 {&__pyx_n_s_pycAffineMatrixFunction, __pyx_k_pycAffineMatrixFunction,
sizeof(__pyx_k_pycAffineMatrixFunction), 0, 0, 1, 1},
26369 {&__pyx_n_s_pycAffineMatrixFunction___reduce, __pyx_k_pycAffineMatrixFunction___reduce,
sizeof(__pyx_k_pycAffineMatrixFunction___reduce), 0, 0, 1, 1},
26370 {&__pyx_n_s_pycAffineMatrixFunction___setsta, __pyx_k_pycAffineMatrixFunction___setsta,
sizeof(__pyx_k_pycAffineMatrixFunction___setsta), 0, 0, 1, 1},
26371 {&__pyx_n_s_pycAffineMatrixFunction_set_csc, __pyx_k_pycAffineMatrixFunction_set_csc,
sizeof(__pyx_k_pycAffineMatrixFunction_set_csc), 0, 0, 1, 1},
26372 {&__pyx_n_s_pycAffineMatrixFunction_set_csc_2, __pyx_k_pycAffineMatrixFunction_set_csc_2,
sizeof(__pyx_k_pycAffineMatrixFunction_set_csc_2), 0, 0, 1, 1},
26373 {&__pyx_n_s_pycAffineMatrixFunction_set_csc_3, __pyx_k_pycAffineMatrixFunction_set_csc_3,
sizeof(__pyx_k_pycAffineMatrixFunction_set_csc_3), 0, 0, 1, 1},
26374 {&__pyx_n_s_pycAffineMatrixFunction_set_csr, __pyx_k_pycAffineMatrixFunction_set_csr,
sizeof(__pyx_k_pycAffineMatrixFunction_set_csr), 0, 0, 1, 1},
26375 {&__pyx_n_s_pycAffineMatrixFunction_set_csr_2, __pyx_k_pycAffineMatrixFunction_set_csr_2,
sizeof(__pyx_k_pycAffineMatrixFunction_set_csr_2), 0, 0, 1, 1},
26376 {&__pyx_n_s_pycAffineMatrixFunction_set_csr_3, __pyx_k_pycAffineMatrixFunction_set_csr_3,
sizeof(__pyx_k_pycAffineMatrixFunction_set_csr_3), 0, 0, 1, 1},
26377 {&__pyx_n_s_pycAffineMatrixFunction_set_dens, __pyx_k_pycAffineMatrixFunction_set_dens,
sizeof(__pyx_k_pycAffineMatrixFunction_set_dens), 0, 0, 1, 1},
26378 {&__pyx_n_s_pycAffineMatrixFunction_set_dens_2, __pyx_k_pycAffineMatrixFunction_set_dens_2,
sizeof(__pyx_k_pycAffineMatrixFunction_set_dens_2), 0, 0, 1, 1},
26379 {&__pyx_n_s_pycAffineMatrixFunction_set_dens_3, __pyx_k_pycAffineMatrixFunction_set_dens_3,
sizeof(__pyx_k_pycAffineMatrixFunction_set_dens_3), 0, 0, 1, 1},
26380 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
26381 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
26382 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
26383 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
26384 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
26385 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
26386 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
26387 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
26388 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
26389 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
26390 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
26391 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
26392 {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse,
sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
26393 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
26394 {&__pyx_n_s_set_csc_matrix_double, __pyx_k_set_csc_matrix_double,
sizeof(__pyx_k_set_csc_matrix_double), 0, 0, 1, 1},
26395 {&__pyx_n_s_set_csc_matrix_float, __pyx_k_set_csc_matrix_float,
sizeof(__pyx_k_set_csc_matrix_float), 0, 0, 1, 1},
26396 {&__pyx_n_s_set_csc_matrix_long_double, __pyx_k_set_csc_matrix_long_double,
sizeof(__pyx_k_set_csc_matrix_long_double), 0, 0, 1, 1},
26397 {&__pyx_n_s_set_csr_matrix_double, __pyx_k_set_csr_matrix_double,
sizeof(__pyx_k_set_csr_matrix_double), 0, 0, 1, 1},
26398 {&__pyx_n_s_set_csr_matrix_float, __pyx_k_set_csr_matrix_float,
sizeof(__pyx_k_set_csr_matrix_float), 0, 0, 1, 1},
26399 {&__pyx_n_s_set_csr_matrix_long_double, __pyx_k_set_csr_matrix_long_double,
sizeof(__pyx_k_set_csr_matrix_long_double), 0, 0, 1, 1},
26400 {&__pyx_n_s_set_dense_matrix_double, __pyx_k_set_dense_matrix_double,
sizeof(__pyx_k_set_dense_matrix_double), 0, 0, 1, 1},
26401 {&__pyx_n_s_set_dense_matrix_float, __pyx_k_set_dense_matrix_float,
sizeof(__pyx_k_set_dense_matrix_float), 0, 0, 1, 1},
26402 {&__pyx_n_s_set_dense_matrix_long_double, __pyx_k_set_dense_matrix_long_double,
sizeof(__pyx_k_set_dense_matrix_long_double), 0, 0, 1, 1},
26403 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
26404 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
26405 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
26406 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
26407 {&__pyx_n_s_sort_indices, __pyx_k_sort_indices,
sizeof(__pyx_k_sort_indices), 0, 0, 1, 1},
26408 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
26409 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
26410 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
26411 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
26412 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
26413 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
26414 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
26415 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
26416 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
26417 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
26418 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
26419 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
26420 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
26421 {0, 0, 0, 0, 0, 0, 0}
26423 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
26424 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 179, __pyx_L1_error)
26425 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 192, __pyx_L1_error)
26426 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
26427 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
26428 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
26429 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
26430 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
26431 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
26437 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
26438 __Pyx_RefNannyDeclarations
26439 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
26448 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_A_cannot_be_None);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 179, __pyx_L1_error)
26449 __Pyx_GOTREF(__pyx_tuple_);
26450 __Pyx_GIVEREF(__pyx_tuple_);
26459 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Input_matrix_should_be_a_2_dimen);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 182, __pyx_L1_error)
26460 __Pyx_GOTREF(__pyx_tuple__2);
26461 __Pyx_GIVEREF(__pyx_tuple__2);
26470 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_float32_floa);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 192, __pyx_L1_error)
26471 __Pyx_GOTREF(__pyx_tuple__3);
26472 __Pyx_GIVEREF(__pyx_tuple__3);
26481 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Matrices_A_and_B_should_have_sim);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 208, __pyx_L1_error)
26482 __Pyx_GOTREF(__pyx_tuple__4);
26483 __Pyx_GIVEREF(__pyx_tuple__4);
26492 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_A_and_B_should_have_similar_data);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 212, __pyx_L1_error)
26493 __Pyx_GOTREF(__pyx_tuple__5);
26494 __Pyx_GIVEREF(__pyx_tuple__5);
26503 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_A_and_B_should_have_the_same_sha);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 216, __pyx_L1_error)
26504 __Pyx_GOTREF(__pyx_tuple__6);
26505 __Pyx_GIVEREF(__pyx_tuple__6);
26514 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Matrix_A_should_be_either_C_or_F);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 327, __pyx_L1_error)
26515 __Pyx_GOTREF(__pyx_tuple__8);
26516 __Pyx_GIVEREF(__pyx_tuple__8);
26525 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Matrix_B_should_be_either_C_or_F);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 335, __pyx_L1_error)
26526 __Pyx_GOTREF(__pyx_tuple__9);
26527 __Pyx_GIVEREF(__pyx_tuple__9);
26535 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error)
26536 __Pyx_GOTREF(__pyx_tuple__19);
26537 __Pyx_GIVEREF(__pyx_tuple__19);
26544 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
26545 __Pyx_GOTREF(__pyx_tuple__21);
26546 __Pyx_GIVEREF(__pyx_tuple__21);
26555 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 133, __pyx_L1_error)
26556 __Pyx_GOTREF(__pyx_tuple__22);
26557 __Pyx_GIVEREF(__pyx_tuple__22);
26566 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 136, __pyx_L1_error)
26567 __Pyx_GOTREF(__pyx_tuple__23);
26568 __Pyx_GIVEREF(__pyx_tuple__23);
26577 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 148, __pyx_L1_error)
26578 __Pyx_GOTREF(__pyx_tuple__24);
26579 __Pyx_GIVEREF(__pyx_tuple__24);
26588 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 176, __pyx_L1_error)
26589 __Pyx_GOTREF(__pyx_tuple__25);
26590 __Pyx_GIVEREF(__pyx_tuple__25);
26599 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 192, __pyx_L1_error)
26600 __Pyx_GOTREF(__pyx_tuple__26);
26601 __Pyx_GIVEREF(__pyx_tuple__26);
26609 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
26610 __Pyx_GOTREF(__pyx_tuple__27);
26611 __Pyx_GIVEREF(__pyx_tuple__27);
26618 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
26619 __Pyx_GOTREF(__pyx_tuple__28);
26620 __Pyx_GIVEREF(__pyx_tuple__28);
26629 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 418, __pyx_L1_error)
26630 __Pyx_GOTREF(__pyx_tuple__29);
26631 __Pyx_GIVEREF(__pyx_tuple__29);
26640 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 495, __pyx_L1_error)
26641 __Pyx_GOTREF(__pyx_tuple__30);
26642 __Pyx_GIVEREF(__pyx_tuple__30);
26651 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 520, __pyx_L1_error)
26652 __Pyx_GOTREF(__pyx_tuple__31);
26653 __Pyx_GIVEREF(__pyx_tuple__31);
26662 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 570, __pyx_L1_error)
26663 __Pyx_GOTREF(__pyx_tuple__32);
26664 __Pyx_GIVEREF(__pyx_tuple__32);
26673 __pyx_tuple__33 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 577, __pyx_L1_error)
26674 __Pyx_GOTREF(__pyx_tuple__33);
26675 __Pyx_INCREF(__pyx_int_neg_1);
26676 __Pyx_GIVEREF(__pyx_int_neg_1);
26677 PyTuple_SET_ITEM(__pyx_tuple__33, 0, __pyx_int_neg_1);
26678 __Pyx_GIVEREF(__pyx_tuple__33);
26686 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
26687 __Pyx_GOTREF(__pyx_tuple__34);
26688 __Pyx_GIVEREF(__pyx_tuple__34);
26695 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
26696 __Pyx_GOTREF(__pyx_tuple__35);
26697 __Pyx_GIVEREF(__pyx_tuple__35);
26706 __pyx_slice__36 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__36)) __PYX_ERR(1, 682, __pyx_L1_error)
26707 __Pyx_GOTREF(__pyx_slice__36);
26708 __Pyx_GIVEREF(__pyx_slice__36);
26717 __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 703, __pyx_L1_error)
26718 __Pyx_GOTREF(__pyx_tuple__37);
26719 __Pyx_GIVEREF(__pyx_tuple__37);
26727 __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 2, __pyx_L1_error)
26728 __Pyx_GOTREF(__pyx_tuple__38);
26729 __Pyx_GIVEREF(__pyx_tuple__38);
26736 __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 4, __pyx_L1_error)
26737 __Pyx_GOTREF(__pyx_tuple__39);
26738 __Pyx_GIVEREF(__pyx_tuple__39);
26747 __pyx_tuple__41 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_B_is_row_major, __pyx_n_s_A_data_mv_c, __pyx_n_s_A_data_mv_f, __pyx_n_s_B_data_mv_c, __pyx_n_s_B_data_mv_f, __pyx_n_s_A_data, __pyx_n_s_B_data);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 306, __pyx_L1_error)
26748 __Pyx_GOTREF(__pyx_tuple__41);
26749 __Pyx_GIVEREF(__pyx_tuple__41);
26750 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_dense_matrix_float, 306, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 306, __pyx_L1_error)
26759 __pyx_tuple__42 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_B_is_row_major, __pyx_n_s_A_data_mv_c, __pyx_n_s_A_data_mv_f, __pyx_n_s_B_data_mv_c, __pyx_n_s_B_data_mv_f, __pyx_n_s_A_data, __pyx_n_s_B_data);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 402, __pyx_L1_error)
26760 __Pyx_GOTREF(__pyx_tuple__42);
26761 __Pyx_GIVEREF(__pyx_tuple__42);
26762 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_dense_matrix_double, 402, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 402, __pyx_L1_error)
26771 __pyx_tuple__43 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_B_is_row_major, __pyx_n_s_A_data_mv_c, __pyx_n_s_A_data_mv_f, __pyx_n_s_B_data_mv_c, __pyx_n_s_B_data_mv_f, __pyx_n_s_A_data, __pyx_n_s_B_data);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 498, __pyx_L1_error)
26772 __Pyx_GOTREF(__pyx_tuple__43);
26773 __Pyx_GIVEREF(__pyx_tuple__43);
26774 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_dense_matrix_long_double, 498, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 498, __pyx_L1_error)
26783 __pyx_tuple__44 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 594, __pyx_L1_error)
26784 __Pyx_GOTREF(__pyx_tuple__44);
26785 __Pyx_GIVEREF(__pyx_tuple__44);
26786 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csr_matrix_float, 594, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 594, __pyx_L1_error)
26795 __pyx_tuple__45 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 665, __pyx_L1_error)
26796 __Pyx_GOTREF(__pyx_tuple__45);
26797 __Pyx_GIVEREF(__pyx_tuple__45);
26798 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csr_matrix_double, 665, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 665, __pyx_L1_error)
26807 __pyx_tuple__46 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 736, __pyx_L1_error)
26808 __Pyx_GOTREF(__pyx_tuple__46);
26809 __Pyx_GIVEREF(__pyx_tuple__46);
26810 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csr_matrix_long_double, 736, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 736, __pyx_L1_error)
26819 __pyx_tuple__47 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 807, __pyx_L1_error)
26820 __Pyx_GOTREF(__pyx_tuple__47);
26821 __Pyx_GIVEREF(__pyx_tuple__47);
26822 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csc_matrix_float, 807, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 807, __pyx_L1_error)
26831 __pyx_tuple__48 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 878, __pyx_L1_error)
26832 __Pyx_GOTREF(__pyx_tuple__48);
26833 __Pyx_GIVEREF(__pyx_tuple__48);
26834 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csc_matrix_double, 878, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 878, __pyx_L1_error)
26843 __pyx_tuple__49 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 949, __pyx_L1_error)
26844 __Pyx_GOTREF(__pyx_tuple__49);
26845 __Pyx_GIVEREF(__pyx_tuple__49);
26846 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csc_matrix_long_double, 949, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 949, __pyx_L1_error)
26853 __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 1, __pyx_L1_error)
26854 __Pyx_GOTREF(__pyx_tuple__50);
26855 __Pyx_GIVEREF(__pyx_tuple__50);
26856 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 1, __pyx_L1_error)
26864 __pyx_tuple__51 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 3, __pyx_L1_error)
26865 __Pyx_GOTREF(__pyx_tuple__51);
26866 __Pyx_GIVEREF(__pyx_tuple__51);
26867 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 3, __pyx_L1_error)
26876 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 286, __pyx_L1_error)
26877 __Pyx_GOTREF(__pyx_tuple__52);
26878 __Pyx_GIVEREF(__pyx_tuple__52);
26887 __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 287, __pyx_L1_error)
26888 __Pyx_GOTREF(__pyx_tuple__53);
26889 __Pyx_GIVEREF(__pyx_tuple__53);
26898 __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 288, __pyx_L1_error)
26899 __Pyx_GOTREF(__pyx_tuple__54);
26900 __Pyx_GIVEREF(__pyx_tuple__54);
26909 __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 291, __pyx_L1_error)
26910 __Pyx_GOTREF(__pyx_tuple__55);
26911 __Pyx_GIVEREF(__pyx_tuple__55);
26920 __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 292, __pyx_L1_error)
26921 __Pyx_GOTREF(__pyx_tuple__56);
26922 __Pyx_GIVEREF(__pyx_tuple__56);
26929 __pyx_tuple__57 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 1, __pyx_L1_error)
26930 __Pyx_GOTREF(__pyx_tuple__57);
26931 __Pyx_GIVEREF(__pyx_tuple__57);
26932 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 1, __pyx_L1_error)
26933 __Pyx_RefNannyFinishContext();
26936 __Pyx_RefNannyFinishContext();
26940 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
26941 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
26942 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
26943 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26944 __pyx_int_2 = PyInt_FromLong(2);
if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
26945 __pyx_int_184977713 = PyInt_FromLong(184977713L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
26946 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26952 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
26953 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
26954 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
26955 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
26956 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
26957 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
26958 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
26960 static int __Pyx_modinit_global_init_code(
void) {
26961 __Pyx_RefNannyDeclarations
26962 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
26964 generic = Py_None; Py_INCREF(Py_None);
26965 strided = Py_None; Py_INCREF(Py_None);
26966 indirect = Py_None; Py_INCREF(Py_None);
26967 contiguous = Py_None; Py_INCREF(Py_None);
26968 indirect_contiguous = Py_None; Py_INCREF(Py_None);
26969 __Pyx_RefNannyFinishContext();
26973 static int __Pyx_modinit_variable_export_code(
void) {
26974 __Pyx_RefNannyDeclarations
26975 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
26977 __Pyx_RefNannyFinishContext();
26981 static int __Pyx_modinit_function_export_code(
void) {
26982 __Pyx_RefNannyDeclarations
26983 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
26985 __Pyx_RefNannyFinishContext();
26989 static int __Pyx_modinit_type_init_code(
void) {
26990 __Pyx_RefNannyDeclarations
26991 PyObject *__pyx_t_1 = NULL;
26992 int __pyx_lineno = 0;
26993 const char *__pyx_filename = NULL;
26994 int __pyx_clineno = 0;
26995 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
26997 __pyx_t_1 = PyImport_ImportModule(
"imate._c_linear_operator.py_c_linear_operator");
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26998 __Pyx_GOTREF(__pyx_t_1);
26999 __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = __Pyx_ImportType(__pyx_t_1,
"imate._c_linear_operator.py_c_linear_operator",
"pycLinearOperator",
sizeof(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator), __Pyx_ImportType_CheckSize_Warn);
27000 if (!__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) __PYX_ERR(0, 1, __pyx_L1_error)
27001 __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = (
struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict);
if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __PYX_ERR(0, 1, __pyx_L1_error)
27002 __pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = &__pyx_vtable_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
27003 __pyx_vtable_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.__pyx_base = *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
27004 __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_base = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
27005 if (PyType_Ready(&__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27006 #if PY_VERSION_HEX < 0x030800B1
27007 __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_print = 0;
27009 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_dictoffset && __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_getattro == PyObject_GenericGetAttr)) {
27010 __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27012 if (__Pyx_SetVtable(__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_dict, __pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27013 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pycAffineMatrixFunction, (PyObject *)&__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27014 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27015 __pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = &__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
27016 __pyx_vtabptr_array = &__pyx_vtable_array;
27017 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
27018 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
27019 #if PY_VERSION_HEX < 0x030800B1
27020 __pyx_type___pyx_array.tp_print = 0;
27022 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
27023 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
27024 __pyx_array_type = &__pyx_type___pyx_array;
27025 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
27026 #if PY_VERSION_HEX < 0x030800B1
27027 __pyx_type___pyx_MemviewEnum.tp_print = 0;
27029 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
27030 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27032 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
27033 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
27034 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
27035 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
27036 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
27037 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
27038 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
27039 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
27040 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
27041 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
27042 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
27043 #if PY_VERSION_HEX < 0x030800B1
27044 __pyx_type___pyx_memoryview.tp_print = 0;
27046 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
27047 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27049 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
27050 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
27051 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
27052 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
27053 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
27054 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
27055 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
27056 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
27057 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
27058 #if PY_VERSION_HEX < 0x030800B1
27059 __pyx_type___pyx_memoryviewslice.tp_print = 0;
27061 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
27062 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27064 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
27065 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
27066 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
27067 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27068 __Pyx_RefNannyFinishContext();
27071 __Pyx_XDECREF(__pyx_t_1);
27072 __Pyx_RefNannyFinishContext();
27076 static int __Pyx_modinit_type_import_code(
void) {
27077 __Pyx_RefNannyDeclarations
27078 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
27080 __Pyx_RefNannyFinishContext();
27084 static int __Pyx_modinit_variable_import_code(
void) {
27085 __Pyx_RefNannyDeclarations
27086 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
27088 __Pyx_RefNannyFinishContext();
27092 static int __Pyx_modinit_function_import_code(
void) {
27093 __Pyx_RefNannyDeclarations
27094 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
27096 __Pyx_RefNannyFinishContext();
27101 #ifndef CYTHON_NO_PYINIT_EXPORT
27102 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
27103 #elif PY_MAJOR_VERSION < 3
27105 #define __Pyx_PyMODINIT_FUNC extern "C" void
27107 #define __Pyx_PyMODINIT_FUNC void
27111 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
27113 #define __Pyx_PyMODINIT_FUNC PyObject *
27118 #if PY_MAJOR_VERSION < 3
27119 __Pyx_PyMODINIT_FUNC initpy_c_affine_matrix_function(
void) CYTHON_SMALL_CODE;
27120 __Pyx_PyMODINIT_FUNC initpy_c_affine_matrix_function(
void)
27122 __Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(
void) CYTHON_SMALL_CODE;
27123 __Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(
void)
27124 #if CYTHON_PEP489_MULTI_PHASE_INIT
27126 return PyModuleDef_Init(&__pyx_moduledef);
27128 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
27129 #if PY_VERSION_HEX >= 0x030700A1
27130 static PY_INT64_T main_interpreter_id = -1;
27131 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
27132 if (main_interpreter_id == -1) {
27133 main_interpreter_id = current_id;
27134 return (unlikely(current_id == -1)) ? -1 : 0;
27135 }
else if (unlikely(main_interpreter_id != current_id))
27137 static PyInterpreterState *main_interpreter = NULL;
27138 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
27139 if (!main_interpreter) {
27140 main_interpreter = current_interpreter;
27141 }
else if (unlikely(main_interpreter != current_interpreter))
27146 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
27151 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
27152 PyObject *value = PyObject_GetAttrString(spec, from_name);
27154 if (likely(value)) {
27155 if (allow_none || value != Py_None) {
27156 result = PyDict_SetItemString(moddict, to_name, value);
27159 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
27166 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
27167 PyObject *module = NULL, *moddict, *modname;
27168 if (__Pyx_check_single_interpreter())
27171 return __Pyx_NewRef(__pyx_m);
27172 modname = PyObject_GetAttrString(spec,
"name");
27173 if (unlikely(!modname))
goto bad;
27174 module = PyModule_NewObject(modname);
27175 Py_DECREF(modname);
27176 if (unlikely(!module))
goto bad;
27177 moddict = PyModule_GetDict(module);
27178 if (unlikely(!moddict))
goto bad;
27179 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
27180 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
27181 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
27182 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
27185 Py_XDECREF(module);
27190 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_py_c_affine_matrix_function(PyObject *__pyx_pyinit_module)
27194 __Pyx_TraceDeclarations
27195 PyObject *__pyx_t_1 = NULL;
27196 PyObject *__pyx_t_2 = NULL;
27197 static PyThread_type_lock __pyx_t_3[8];
27198 int __pyx_lineno = 0;
27199 const char *__pyx_filename = NULL;
27200 int __pyx_clineno = 0;
27201 __Pyx_RefNannyDeclarations
27202 #if CYTHON_PEP489_MULTI_PHASE_INIT
27204 if (__pyx_m == __pyx_pyinit_module)
return 0;
27205 PyErr_SetString(PyExc_RuntimeError,
"Module 'py_c_affine_matrix_function' has already been imported. Re-initialisation is not supported.");
27208 #elif PY_MAJOR_VERSION >= 3
27209 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
27211 #if CYTHON_REFNANNY
27212 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
27213 if (!__Pyx_RefNanny) {
27215 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
27216 if (!__Pyx_RefNanny)
27217 Py_FatalError(
"failed to import 'refnanny' module");
27220 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(void)", 0);
27221 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27222 #ifdef __Pxy_PyFrame_Initialize_Offsets
27223 __Pxy_PyFrame_Initialize_Offsets();
27225 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
27226 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
27227 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
27228 #ifdef __Pyx_CyFunction_USED
27229 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27231 #ifdef __Pyx_FusedFunction_USED
27232 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27234 #ifdef __Pyx_Coroutine_USED
27235 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27237 #ifdef __Pyx_Generator_USED
27238 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27240 #ifdef __Pyx_AsyncGen_USED
27241 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27243 #ifdef __Pyx_StopAsyncIteration_USED
27244 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27248 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
27249 PyEval_InitThreads();
27252 #if CYTHON_PEP489_MULTI_PHASE_INIT
27253 __pyx_m = __pyx_pyinit_module;
27254 Py_INCREF(__pyx_m);
27256 #if PY_MAJOR_VERSION < 3
27257 __pyx_m = Py_InitModule4(
"py_c_affine_matrix_function", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
27259 __pyx_m = PyModule_Create(&__pyx_moduledef);
27261 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
27263 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
27264 Py_INCREF(__pyx_d);
27265 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
27266 Py_INCREF(__pyx_b);
27267 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
27268 Py_INCREF(__pyx_cython_runtime);
27269 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
27271 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27272 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
27273 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27275 if (__pyx_module_is_main_imate___c_linear_operator__py_c_affine_matrix_function) {
27276 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27278 #if PY_MAJOR_VERSION >= 3
27280 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
27281 if (!PyDict_GetItemString(modules,
"imate._c_linear_operator.py_c_affine_matrix_function")) {
27282 if (unlikely(PyDict_SetItemString(modules,
"imate._c_linear_operator.py_c_affine_matrix_function", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
27287 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27289 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27291 (void)__Pyx_modinit_global_init_code();
27292 (void)__Pyx_modinit_variable_export_code();
27293 (void)__Pyx_modinit_function_export_code();
27294 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
27295 (void)__Pyx_modinit_type_import_code();
27296 (void)__Pyx_modinit_variable_import_code();
27297 (void)__Pyx_modinit_function_import_code();
27299 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
27300 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27302 __Pyx_TraceCall(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
27311 __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
27312 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
27313 __Pyx_GOTREF(__pyx_t_1);
27314 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
27315 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27324 __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
27325 __pyx_t_1 = PyList_New(4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27326 __Pyx_GOTREF(__pyx_t_1);
27327 __Pyx_INCREF(__pyx_n_s_issparse);
27328 __Pyx_GIVEREF(__pyx_n_s_issparse);
27329 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_issparse);
27330 __Pyx_INCREF(__pyx_n_s_isspmatrix_csr);
27331 __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csr);
27332 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_isspmatrix_csr);
27333 __Pyx_INCREF(__pyx_n_s_isspmatrix_csc);
27334 __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csc);
27335 PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_isspmatrix_csc);
27336 __Pyx_INCREF(__pyx_n_s_csr_matrix);
27337 __Pyx_GIVEREF(__pyx_n_s_csr_matrix);
27338 PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_csr_matrix);
27339 __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
27340 __Pyx_GOTREF(__pyx_t_2);
27341 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27342 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_issparse);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27343 __Pyx_GOTREF(__pyx_t_1);
27344 if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27345 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27346 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27347 __Pyx_GOTREF(__pyx_t_1);
27348 if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csr, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27349 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27350 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27351 __Pyx_GOTREF(__pyx_t_1);
27352 if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csc, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27353 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27354 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csr_matrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27355 __Pyx_GOTREF(__pyx_t_1);
27356 if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27357 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27358 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27367 __Pyx_TraceLine(306,0,__PYX_ERR(0, 306, __pyx_L1_error))
27368 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_dens, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__7));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
27369 __Pyx_GOTREF(__pyx_t_2);
27370 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_dense_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
27371 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27372 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27381 __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error))
27382 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_dens_2, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__10));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
27383 __Pyx_GOTREF(__pyx_t_2);
27384 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_dense_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
27385 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27386 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27395 __Pyx_TraceLine(498,0,__PYX_ERR(0, 498, __pyx_L1_error))
27396 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_dens_3, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__11));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
27397 __Pyx_GOTREF(__pyx_t_2);
27398 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_dense_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 498, __pyx_L1_error)
27399 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27400 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27409 __Pyx_TraceLine(594,0,__PYX_ERR(0, 594, __pyx_L1_error))
27410 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csr, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__12));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error)
27411 __Pyx_GOTREF(__pyx_t_2);
27412 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csr_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 594, __pyx_L1_error)
27413 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27414 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27423 __Pyx_TraceLine(665,0,__PYX_ERR(0, 665, __pyx_L1_error))
27424 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csr_2, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__13));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
27425 __Pyx_GOTREF(__pyx_t_2);
27426 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csr_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 665, __pyx_L1_error)
27427 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27428 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27437 __Pyx_TraceLine(736,0,__PYX_ERR(0, 736, __pyx_L1_error))
27438 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csr_3, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__14));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __pyx_L1_error)
27439 __Pyx_GOTREF(__pyx_t_2);
27440 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csr_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
27441 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27442 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27451 __Pyx_TraceLine(807,0,__PYX_ERR(0, 807, __pyx_L1_error))
27452 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csc, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__15));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error)
27453 __Pyx_GOTREF(__pyx_t_2);
27454 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csc_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 807, __pyx_L1_error)
27455 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27456 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27465 __Pyx_TraceLine(878,0,__PYX_ERR(0, 878, __pyx_L1_error))
27466 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csc_2, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__16));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error)
27467 __Pyx_GOTREF(__pyx_t_2);
27468 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csc_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 878, __pyx_L1_error)
27469 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27470 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27479 __Pyx_TraceLine(949,0,__PYX_ERR(0, 949, __pyx_L1_error))
27480 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csc_3, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__17));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error)
27481 __Pyx_GOTREF(__pyx_t_2);
27482 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csc_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 949, __pyx_L1_error)
27483 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27484 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27491 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
27492 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction___reduce, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__18));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
27493 __Pyx_GOTREF(__pyx_t_2);
27494 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
27495 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27503 __Pyx_TraceLine(3,0,__PYX_ERR(1, 3, __pyx_L1_error))
27504 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction___setsta, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__20));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
27505 __Pyx_GOTREF(__pyx_t_2);
27506 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
27507 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27514 __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
27515 __pyx_t_2 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
27516 __Pyx_GOTREF(__pyx_t_2);
27517 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27518 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27527 __Pyx_TraceLine(209,0,__PYX_ERR(1, 209, __pyx_L1_error))
27528 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 209, __pyx_L1_error)
27529 __Pyx_GOTREF(__pyx_t_2);
27530 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
27531 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27532 PyType_Modified(__pyx_array_type);
27541 __Pyx_TraceLine(226,0,__PYX_ERR(1, 226, __pyx_L1_error))
27551 __Pyx_TraceLine(244,0,__PYX_ERR(1, 244, __pyx_L1_error))
27561 __Pyx_TraceLine(286,0,__PYX_ERR(1, 286, __pyx_L1_error))
27562 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 286, __pyx_L1_error)
27563 __Pyx_GOTREF(__pyx_t_2);
27564 __Pyx_XGOTREF(
generic);
27565 __Pyx_DECREF_SET(
generic, __pyx_t_2);
27566 __Pyx_GIVEREF(__pyx_t_2);
27576 __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
27577 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
27578 __Pyx_GOTREF(__pyx_t_2);
27579 __Pyx_XGOTREF(strided);
27580 __Pyx_DECREF_SET(strided, __pyx_t_2);
27581 __Pyx_GIVEREF(__pyx_t_2);
27591 __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
27592 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
27593 __Pyx_GOTREF(__pyx_t_2);
27594 __Pyx_XGOTREF(indirect);
27595 __Pyx_DECREF_SET(indirect, __pyx_t_2);
27596 __Pyx_GIVEREF(__pyx_t_2);
27606 __Pyx_TraceLine(291,0,__PYX_ERR(1, 291, __pyx_L1_error))
27607 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 291, __pyx_L1_error)
27608 __Pyx_GOTREF(__pyx_t_2);
27609 __Pyx_XGOTREF(contiguous);
27610 __Pyx_DECREF_SET(contiguous, __pyx_t_2);
27611 __Pyx_GIVEREF(__pyx_t_2);
27621 __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
27622 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
27623 __Pyx_GOTREF(__pyx_t_2);
27624 __Pyx_XGOTREF(indirect_contiguous);
27625 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
27626 __Pyx_GIVEREF(__pyx_t_2);
27636 __Pyx_TraceLine(298,0,__PYX_ERR(1, 298, __pyx_L1_error))
27646 __Pyx_TraceLine(316,0,__PYX_ERR(1, 316, __pyx_L1_error))
27647 __pyx_memoryview_thread_locks_used = 0;
27656 __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
27657 __pyx_t_3[0] = PyThread_allocate_lock();
27658 __pyx_t_3[1] = PyThread_allocate_lock();
27659 __pyx_t_3[2] = PyThread_allocate_lock();
27660 __pyx_t_3[3] = PyThread_allocate_lock();
27661 __pyx_t_3[4] = PyThread_allocate_lock();
27662 __pyx_t_3[5] = PyThread_allocate_lock();
27663 __pyx_t_3[6] = PyThread_allocate_lock();
27664 __pyx_t_3[7] = PyThread_allocate_lock();
27665 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
27674 __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
27684 __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
27694 __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
27704 __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
27714 __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L1_error))
27724 __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
27734 __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L1_error))
27744 __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
27745 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 549, __pyx_L1_error)
27746 __Pyx_GOTREF(__pyx_t_2);
27747 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
27748 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27749 PyType_Modified(__pyx_memoryview_type);
27758 __Pyx_TraceLine(657,0,__PYX_ERR(1, 657, __pyx_L1_error))
27768 __Pyx_TraceLine(663,0,__PYX_ERR(1, 663, __pyx_L1_error))
27778 __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
27788 __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
27798 __Pyx_TraceLine(710,0,__PYX_ERR(1, 710, __pyx_L1_error))
27808 __Pyx_TraceLine(807,0,__PYX_ERR(1, 807, __pyx_L1_error))
27818 __Pyx_TraceLine(910,0,__PYX_ERR(1, 910, __pyx_L1_error))
27828 __Pyx_TraceLine(943,0,__PYX_ERR(1, 943, __pyx_L1_error))
27838 __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
27848 __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
27858 __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
27859 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 995, __pyx_L1_error)
27860 __Pyx_GOTREF(__pyx_t_2);
27861 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
27862 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27863 PyType_Modified(__pyx_memoryviewslice_type);
27872 __Pyx_TraceLine(999,0,__PYX_ERR(1, 999, __pyx_L1_error))
27882 __Pyx_TraceLine(1052,0,__PYX_ERR(1, 1052, __pyx_L1_error))
27892 __Pyx_TraceLine(1063,0,__PYX_ERR(1, 1063, __pyx_L1_error))
27902 __Pyx_TraceLine(1080,0,__PYX_ERR(1, 1080, __pyx_L1_error))
27912 __Pyx_TraceLine(1087,0,__PYX_ERR(1, 1087, __pyx_L1_error))
27922 __Pyx_TraceLine(1109,0,__PYX_ERR(1, 1109, __pyx_L1_error))
27932 __Pyx_TraceLine(1116,0,__PYX_ERR(1, 1116, __pyx_L1_error))
27942 __Pyx_TraceLine(1170,0,__PYX_ERR(1, 1170, __pyx_L1_error))
27952 __Pyx_TraceLine(1177,0,__PYX_ERR(1, 1177, __pyx_L1_error))
27962 __Pyx_TraceLine(1187,0,__PYX_ERR(1, 1187, __pyx_L1_error))
27972 __Pyx_TraceLine(1208,0,__PYX_ERR(1, 1208, __pyx_L1_error))
27982 __Pyx_TraceLine(1251,0,__PYX_ERR(1, 1251, __pyx_L1_error))
27992 __Pyx_TraceLine(1257,0,__PYX_ERR(1, 1257, __pyx_L1_error))
28002 __Pyx_TraceLine(1261,0,__PYX_ERR(1, 1261, __pyx_L1_error))
28012 __Pyx_TraceLine(1268,0,__PYX_ERR(1, 1268, __pyx_L1_error))
28022 __Pyx_TraceLine(1340,0,__PYX_ERR(1, 1340, __pyx_L1_error))
28032 __Pyx_TraceLine(1362,0,__PYX_ERR(1, 1362, __pyx_L1_error))
28042 __Pyx_TraceLine(1371,0,__PYX_ERR(1, 1371, __pyx_L1_error))
28052 __Pyx_TraceLine(1377,0,__PYX_ERR(1, 1377, __pyx_L1_error))
28062 __Pyx_TraceLine(1397,0,__PYX_ERR(1, 1397, __pyx_L1_error))
28072 __Pyx_TraceLine(1407,0,__PYX_ERR(1, 1407, __pyx_L1_error))
28080 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
28081 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
28082 __Pyx_GOTREF(__pyx_t_2);
28083 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
28084 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28093 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
28095 __Pyx_TraceReturn(Py_None, 0);
28101 __Pyx_XDECREF(__pyx_t_1);
28102 __Pyx_XDECREF(__pyx_t_2);
28105 __Pyx_AddTraceback(
"init imate._c_linear_operator.py_c_affine_matrix_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
28108 }
else if (!PyErr_Occurred()) {
28109 PyErr_SetString(PyExc_ImportError,
"init imate._c_linear_operator.py_c_affine_matrix_function");
28112 __Pyx_RefNannyFinishContext();
28113 #if CYTHON_PEP489_MULTI_PHASE_INIT
28114 return (__pyx_m != NULL) ? 0 : -1;
28115 #elif PY_MAJOR_VERSION >= 3
28124 #if CYTHON_REFNANNY
28125 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
28126 PyObject *m = NULL, *p = NULL;
28128 m = PyImport_ImportModule(modname);
28130 p = PyObject_GetAttrString(m,
"RefNannyAPI");
28132 r = PyLong_AsVoidPtr(p);
28136 return (__Pyx_RefNannyAPIStruct *)r;
28141 #if CYTHON_USE_TYPE_SLOTS
28142 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
28143 PyTypeObject* tp = Py_TYPE(obj);
28144 if (likely(tp->tp_getattro))
28145 return tp->tp_getattro(obj, attr_name);
28146 #if PY_MAJOR_VERSION < 3
28147 if (likely(tp->tp_getattr))
28148 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
28150 return PyObject_GetAttr(obj, attr_name);
28155 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
28156 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
28157 if (unlikely(!result)) {
28158 PyErr_Format(PyExc_NameError,
28159 #
if PY_MAJOR_VERSION >= 3
28160 "name '%U' is not defined", name);
28162 "name '%.200s' is not defined", PyString_AS_STRING(name));
28169 static void __Pyx_RaiseDoubleKeywordsError(
28170 const char* func_name,
28173 PyErr_Format(PyExc_TypeError,
28174 #
if PY_MAJOR_VERSION >= 3
28175 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
28177 "%s() got multiple values for keyword argument '%s'", func_name,
28178 PyString_AsString(kw_name));
28183 static int __Pyx_ParseOptionalKeywords(
28185 PyObject **argnames[],
28187 PyObject *values[],
28188 Py_ssize_t num_pos_args,
28189 const char* function_name)
28191 PyObject *key = 0, *value = 0;
28192 Py_ssize_t pos = 0;
28194 PyObject*** first_kw_arg = argnames + num_pos_args;
28195 while (PyDict_Next(kwds, &pos, &key, &value)) {
28196 name = first_kw_arg;
28197 while (*name && (**name != key)) name++;
28199 values[name-argnames] = value;
28202 name = first_kw_arg;
28203 #if PY_MAJOR_VERSION < 3
28204 if (likely(PyString_Check(key))) {
28206 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
28207 && _PyString_Eq(**name, key)) {
28208 values[name-argnames] = value;
28213 if (*name)
continue;
28215 PyObject*** argname = argnames;
28216 while (argname != first_kw_arg) {
28217 if ((**argname == key) || (
28218 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
28219 && _PyString_Eq(**argname, key))) {
28220 goto arg_passed_twice;
28227 if (likely(PyUnicode_Check(key))) {
28229 int cmp = (**name == key) ? 0 :
28230 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28231 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28233 PyUnicode_Compare(**name, key);
28234 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
28236 values[name-argnames] = value;
28241 if (*name)
continue;
28243 PyObject*** argname = argnames;
28244 while (argname != first_kw_arg) {
28245 int cmp = (**argname == key) ? 0 :
28246 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28247 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28249 PyUnicode_Compare(**argname, key);
28250 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
28251 if (cmp == 0)
goto arg_passed_twice;
28256 goto invalid_keyword_type;
28258 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
28260 goto invalid_keyword;
28265 __Pyx_RaiseDoubleKeywordsError(function_name, key);
28267 invalid_keyword_type:
28268 PyErr_Format(PyExc_TypeError,
28269 "%.200s() keywords must be strings", function_name);
28272 PyErr_Format(PyExc_TypeError,
28273 #
if PY_MAJOR_VERSION < 3
28274 "%.200s() got an unexpected keyword argument '%.200s'",
28275 function_name, PyString_AsString(key));
28277 "%s() got an unexpected keyword argument '%U'",
28278 function_name, key);
28285 static void __Pyx_RaiseArgtupleInvalid(
28286 const char* func_name,
28288 Py_ssize_t num_min,
28289 Py_ssize_t num_max,
28290 Py_ssize_t num_found)
28292 Py_ssize_t num_expected;
28293 const char *more_or_less;
28294 if (num_found < num_min) {
28295 num_expected = num_min;
28296 more_or_less =
"at least";
28298 num_expected = num_max;
28299 more_or_less =
"at most";
28302 more_or_less =
"exactly";
28304 PyErr_Format(PyExc_TypeError,
28305 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
28306 func_name, more_or_less, num_expected,
28307 (num_expected == 1) ?
"" :
"s", num_found);
28311 #if CYTHON_FAST_THREAD_STATE
28312 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
28313 PyObject *tmp_type, *tmp_value, *tmp_tb;
28314 tmp_type = tstate->curexc_type;
28315 tmp_value = tstate->curexc_value;
28316 tmp_tb = tstate->curexc_traceback;
28317 tstate->curexc_type = type;
28318 tstate->curexc_value = value;
28319 tstate->curexc_traceback = tb;
28320 Py_XDECREF(tmp_type);
28321 Py_XDECREF(tmp_value);
28322 Py_XDECREF(tmp_tb);
28324 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28325 *type = tstate->curexc_type;
28326 *value = tstate->curexc_value;
28327 *tb = tstate->curexc_traceback;
28328 tstate->curexc_type = 0;
28329 tstate->curexc_value = 0;
28330 tstate->curexc_traceback = 0;
28336 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
28337 PyFrameObject** frame,
28338 PyThreadState* tstate,
28339 const char *funcname,
28340 const char *srcfile,
28342 PyObject *type, *value, *traceback;
28344 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
28345 if (*code == NULL) {
28346 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
28347 if (*code == NULL)
return 0;
28349 *frame = PyFrame_New(
28355 if (*frame == NULL)
return 0;
28356 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
28357 Py_INCREF(Py_None);
28358 (*frame)->f_trace = Py_None;
28360 #if PY_VERSION_HEX < 0x030400B1
28362 (*frame)->f_tstate = tstate;
28365 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
28368 __Pyx_SetTracing(tstate, 0);
28369 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
28371 if (tstate->c_tracefunc)
28372 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
28373 if (retval && tstate->c_profilefunc)
28375 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
28376 __Pyx_SetTracing(tstate, (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc)));
28379 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
28380 return __Pyx_IsTracing(tstate, 0, 0) && retval;
28384 Py_XDECREF(traceback);
28388 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno) {
28389 PyCodeObject *py_code = 0;
28390 #if PY_MAJOR_VERSION >= 3
28391 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
28392 if (likely(py_code)) {
28393 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
28396 PyObject *py_srcfile = 0;
28397 PyObject *py_funcname = 0;
28398 py_funcname = PyString_FromString(funcname);
28399 if (unlikely(!py_funcname))
goto bad;
28400 py_srcfile = PyString_FromString(srcfile);
28401 if (unlikely(!py_srcfile))
goto bad;
28402 py_code = PyCode_New(
28406 CO_OPTIMIZED | CO_NEWLOCALS,
28419 Py_XDECREF(py_srcfile);
28420 Py_XDECREF(py_funcname);
28427 #if CYTHON_COMPILING_IN_CPYTHON
28428 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
28430 ternaryfunc call = Py_TYPE(func)->tp_call;
28431 if (unlikely(!call))
28432 return PyObject_Call(func, arg, kw);
28433 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
28435 result = (*call)(func, arg, kw);
28436 Py_LeaveRecursiveCall();
28437 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28440 "NULL result without error in PyObject_Call");
28447 #if PY_MAJOR_VERSION < 3
28448 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
28449 CYTHON_UNUSED PyObject *cause) {
28450 __Pyx_PyThreadState_declare
28452 if (!value || value == Py_None)
28456 if (!tb || tb == Py_None)
28460 if (!PyTraceBack_Check(tb)) {
28461 PyErr_SetString(PyExc_TypeError,
28462 "raise: arg 3 must be a traceback or None");
28466 if (PyType_Check(type)) {
28467 #if CYTHON_COMPILING_IN_PYPY
28469 Py_INCREF(Py_None);
28473 PyErr_NormalizeException(&type, &value, &tb);
28476 PyErr_SetString(PyExc_TypeError,
28477 "instance exception may not have a separate value");
28481 type = (PyObject*) Py_TYPE(type);
28483 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
28484 PyErr_SetString(PyExc_TypeError,
28485 "raise: exception class must be a subclass of BaseException");
28489 __Pyx_PyThreadState_assign
28490 __Pyx_ErrRestore(type, value, tb);
28499 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
28500 PyObject* owned_instance = NULL;
28501 if (tb == Py_None) {
28503 }
else if (tb && !PyTraceBack_Check(tb)) {
28504 PyErr_SetString(PyExc_TypeError,
28505 "raise: arg 3 must be a traceback or None");
28508 if (value == Py_None)
28510 if (PyExceptionInstance_Check(type)) {
28512 PyErr_SetString(PyExc_TypeError,
28513 "instance exception may not have a separate value");
28517 type = (PyObject*) Py_TYPE(value);
28518 }
else if (PyExceptionClass_Check(type)) {
28519 PyObject *instance_class = NULL;
28520 if (value && PyExceptionInstance_Check(value)) {
28521 instance_class = (PyObject*) Py_TYPE(value);
28522 if (instance_class != type) {
28523 int is_subclass = PyObject_IsSubclass(instance_class, type);
28524 if (!is_subclass) {
28525 instance_class = NULL;
28526 }
else if (unlikely(is_subclass == -1)) {
28529 type = instance_class;
28533 if (!instance_class) {
28536 args = PyTuple_New(0);
28537 else if (PyTuple_Check(value)) {
28541 args = PyTuple_Pack(1, value);
28544 owned_instance = PyObject_Call(type, args, NULL);
28546 if (!owned_instance)
28548 value = owned_instance;
28549 if (!PyExceptionInstance_Check(value)) {
28550 PyErr_Format(PyExc_TypeError,
28551 "calling %R should have returned an instance of "
28552 "BaseException, not %R",
28553 type, Py_TYPE(value));
28558 PyErr_SetString(PyExc_TypeError,
28559 "raise: exception class must be a subclass of BaseException");
28563 PyObject *fixed_cause;
28564 if (cause == Py_None) {
28565 fixed_cause = NULL;
28566 }
else if (PyExceptionClass_Check(cause)) {
28567 fixed_cause = PyObject_CallObject(cause, NULL);
28568 if (fixed_cause == NULL)
28570 }
else if (PyExceptionInstance_Check(cause)) {
28571 fixed_cause = cause;
28572 Py_INCREF(fixed_cause);
28574 PyErr_SetString(PyExc_TypeError,
28575 "exception causes must derive from "
28579 PyException_SetCause(value, fixed_cause);
28581 PyErr_SetObject(type, value);
28583 #if CYTHON_COMPILING_IN_PYPY
28584 PyObject *tmp_type, *tmp_value, *tmp_tb;
28585 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
28587 PyErr_Restore(tmp_type, tmp_value, tb);
28588 Py_XDECREF(tmp_tb);
28590 PyThreadState *tstate = __Pyx_PyThreadState_Current;
28591 PyObject* tmp_tb = tstate->curexc_traceback;
28592 if (tb != tmp_tb) {
28594 tstate->curexc_traceback = tb;
28595 Py_XDECREF(tmp_tb);
28600 Py_XDECREF(owned_instance);
28606 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
long inplace) {
28610 #if PY_MAJOR_VERSION < 3
28611 if (likely(PyInt_CheckExact(op1))) {
28612 const long b = intval;
28613 long a = PyInt_AS_LONG(op1);
28614 if (a != b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
28617 #if CYTHON_USE_PYLONG_INTERNALS
28618 if (likely(PyLong_CheckExact(op1))) {
28620 unsigned long uintval;
28621 Py_ssize_t size = Py_SIZE(op1);
28622 const digit* digits = ((PyLongObject*)op1)->ob_digit;
28624 if (size != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
28625 }
else if (intval < 0) {
28634 uintval = (
unsigned long) intval;
28635 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
28636 if (uintval >> (PyLong_SHIFT * 4)) {
28637 unequal = (size != 5) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
28638 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
28641 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
28642 if (uintval >> (PyLong_SHIFT * 3)) {
28643 unequal = (size != 4) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
28644 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
28647 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
28648 if (uintval >> (PyLong_SHIFT * 2)) {
28649 unequal = (size != 3) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
28650 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
28653 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
28654 if (uintval >> (PyLong_SHIFT * 1)) {
28655 unequal = (size != 2) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
28656 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
28659 unequal = (size != 1) || (((
unsigned long) digits[0]) != (uintval & (
unsigned long) PyLong_MASK));
28660 if (unequal != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
28663 if (PyFloat_CheckExact(op1)) {
28664 const long b = intval;
28665 double a = PyFloat_AS_DOUBLE(op1);
28666 if ((
double)a != (
double)b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
28669 PyObject_RichCompare(op1, op2, Py_NE));
28673 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
28674 #if CYTHON_COMPILING_IN_PYPY
28675 return PyObject_RichCompareBool(s1, s2, equals);
28678 return (equals == Py_EQ);
28679 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
28680 const char *ps1, *ps2;
28681 Py_ssize_t length = PyBytes_GET_SIZE(s1);
28682 if (length != PyBytes_GET_SIZE(s2))
28683 return (equals == Py_NE);
28684 ps1 = PyBytes_AS_STRING(s1);
28685 ps2 = PyBytes_AS_STRING(s2);
28686 if (ps1[0] != ps2[0]) {
28687 return (equals == Py_NE);
28688 }
else if (length == 1) {
28689 return (equals == Py_EQ);
28692 #if CYTHON_USE_UNICODE_INTERNALS
28693 Py_hash_t hash1, hash2;
28694 hash1 = ((PyBytesObject*)s1)->ob_shash;
28695 hash2 = ((PyBytesObject*)s2)->ob_shash;
28696 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28697 return (equals == Py_NE);
28700 result = memcmp(ps1, ps2, (
size_t)length);
28701 return (equals == Py_EQ) ? (result == 0) : (result != 0);
28703 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
28704 return (equals == Py_NE);
28705 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
28706 return (equals == Py_NE);
28709 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28712 result = __Pyx_PyObject_IsTrue(py_result);
28713 Py_DECREF(py_result);
28720 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
28721 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
28722 PyObject *dict = Py_TYPE(obj)->tp_dict;
28723 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
28725 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
28726 PyObject **dictptr = NULL;
28727 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
28729 #if CYTHON_COMPILING_IN_CPYTHON
28730 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
28732 dictptr = _PyObject_GetDictPtr(obj);
28735 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
28737 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
28738 PyObject *dict = Py_TYPE(obj)->tp_dict;
28739 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
28741 return obj_dict_version == __Pyx_get_object_dict_version(obj);
28746 #if CYTHON_USE_DICT_VERSIONS
28747 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
28749 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
28753 #if !CYTHON_AVOID_BORROWED_REFS
28754 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
28755 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
28756 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
28757 if (likely(result)) {
28758 return __Pyx_NewRef(result);
28759 }
else if (unlikely(PyErr_Occurred())) {
28763 result = PyDict_GetItem(__pyx_d, name);
28764 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
28765 if (likely(result)) {
28766 return __Pyx_NewRef(result);
28770 result = PyObject_GetItem(__pyx_d, name);
28771 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
28772 if (likely(result)) {
28773 return __Pyx_NewRef(result);
28777 return __Pyx_GetBuiltinName(name);
28781 #if CYTHON_FAST_PYCCALL
28782 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
28783 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
28784 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
28785 PyObject *
self = PyCFunction_GET_SELF(func);
28786 int flags = PyCFunction_GET_FLAGS(func);
28787 assert(PyCFunction_Check(func));
28788 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
28789 assert(nargs >= 0);
28790 assert(nargs == 0 || args != NULL);
28794 assert(!PyErr_Occurred());
28795 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
28796 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
28798 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
28804 #if CYTHON_FAST_PYCALL
28805 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
28806 PyObject *globals) {
28808 PyThreadState *tstate = __Pyx_PyThreadState_Current;
28809 PyObject **fastlocals;
28812 assert(globals != NULL);
28817 assert(tstate != NULL);
28818 f = PyFrame_New(tstate, co, globals, NULL);
28822 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
28823 for (i = 0; i < na; i++) {
28825 fastlocals[i] = *args++;
28827 result = PyEval_EvalFrameEx(f,0);
28828 ++tstate->recursion_depth;
28830 --tstate->recursion_depth;
28833 #if 1 || PY_VERSION_HEX < 0x030600B1
28834 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
28835 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
28836 PyObject *globals = PyFunction_GET_GLOBALS(func);
28837 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
28839 #if PY_MAJOR_VERSION >= 3
28842 PyObject *kwtuple, **k;
28847 assert(kwargs == NULL || PyDict_Check(kwargs));
28848 nk = kwargs ? PyDict_Size(kwargs) : 0;
28849 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
28853 #
if PY_MAJOR_VERSION >= 3
28854 co->co_kwonlyargcount == 0 &&
28856 likely(kwargs == NULL || nk == 0) &&
28857 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
28858 if (argdefs == NULL && co->co_argcount == nargs) {
28859 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
28862 else if (nargs == 0 && argdefs != NULL
28863 && co->co_argcount == Py_SIZE(argdefs)) {
28866 args = &PyTuple_GET_ITEM(argdefs, 0);
28867 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
28871 if (kwargs != NULL) {
28873 kwtuple = PyTuple_New(2 * nk);
28874 if (kwtuple == NULL) {
28878 k = &PyTuple_GET_ITEM(kwtuple, 0);
28880 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
28891 closure = PyFunction_GET_CLOSURE(func);
28892 #if PY_MAJOR_VERSION >= 3
28893 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
28895 if (argdefs != NULL) {
28896 d = &PyTuple_GET_ITEM(argdefs, 0);
28897 nd = Py_SIZE(argdefs);
28903 #if PY_MAJOR_VERSION >= 3
28904 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
28907 d, (
int)nd, kwdefs, closure);
28909 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
28912 d, (
int)nd, closure);
28914 Py_XDECREF(kwtuple);
28916 Py_LeaveRecursiveCall();
28923 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
28924 PyObject *args, *result = NULL;
28925 #if CYTHON_FAST_PYCALL
28926 if (PyFunction_Check(
function)) {
28927 PyObject *args[2] = {arg1, arg2};
28928 return __Pyx_PyFunction_FastCall(
function, args, 2);
28931 #if CYTHON_FAST_PYCCALL
28932 if (__Pyx_PyFastCFunction_Check(
function)) {
28933 PyObject *args[2] = {arg1, arg2};
28934 return __Pyx_PyCFunction_FastCall(
function, args, 2);
28937 args = PyTuple_New(2);
28938 if (unlikely(!args))
goto done;
28940 PyTuple_SET_ITEM(args, 0, arg1);
28942 PyTuple_SET_ITEM(args, 1, arg2);
28943 Py_INCREF(
function);
28944 result = __Pyx_PyObject_Call(
function, args, NULL);
28946 Py_DECREF(
function);
28952 #if CYTHON_COMPILING_IN_CPYTHON
28953 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
28954 PyObject *
self, *result;
28956 cfunc = PyCFunction_GET_FUNCTION(func);
28957 self = PyCFunction_GET_SELF(func);
28958 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
28960 result = cfunc(
self, arg);
28961 Py_LeaveRecursiveCall();
28962 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28965 "NULL result without error in PyObject_Call");
28972 #if CYTHON_COMPILING_IN_CPYTHON
28973 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
28975 PyObject *args = PyTuple_New(1);
28976 if (unlikely(!args))
return NULL;
28978 PyTuple_SET_ITEM(args, 0, arg);
28979 result = __Pyx_PyObject_Call(func, args, NULL);
28983 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
28984 #if CYTHON_FAST_PYCALL
28985 if (PyFunction_Check(func)) {
28986 return __Pyx_PyFunction_FastCall(func, &arg, 1);
28989 if (likely(PyCFunction_Check(func))) {
28990 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
28991 return __Pyx_PyObject_CallMethO(func, arg);
28992 #if CYTHON_FAST_PYCCALL
28993 }
else if (__Pyx_PyFastCFunction_Check(func)) {
28994 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
28998 return __Pyx__PyObject_CallOneArg(func, arg);
29001 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29003 PyObject *args = PyTuple_Pack(1, arg);
29004 if (unlikely(!args))
return NULL;
29005 result = __Pyx_PyObject_Call(func, args, NULL);
29012 #if CYTHON_COMPILING_IN_CPYTHON
29013 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
29014 #if CYTHON_FAST_PYCALL
29015 if (PyFunction_Check(func)) {
29016 return __Pyx_PyFunction_FastCall(func, NULL, 0);
29019 #ifdef __Pyx_CyFunction_USED
29020 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
29022 if (likely(PyCFunction_Check(func)))
29025 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
29026 return __Pyx_PyObject_CallMethO(func, NULL);
29029 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
29034 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
29036 if (!j)
return NULL;
29037 r = PyObject_GetItem(o, j);
29041 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
29042 CYTHON_NCP_UNUSED
int wraparound,
29043 CYTHON_NCP_UNUSED
int boundscheck) {
29044 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29045 Py_ssize_t wrapped_i = i;
29046 if (wraparound & unlikely(i < 0)) {
29047 wrapped_i += PyList_GET_SIZE(o);
29049 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
29050 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
29054 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29056 return PySequence_GetItem(o, i);
29059 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
29060 CYTHON_NCP_UNUSED
int wraparound,
29061 CYTHON_NCP_UNUSED
int boundscheck) {
29062 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29063 Py_ssize_t wrapped_i = i;
29064 if (wraparound & unlikely(i < 0)) {
29065 wrapped_i += PyTuple_GET_SIZE(o);
29067 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
29068 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
29072 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29074 return PySequence_GetItem(o, i);
29077 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
29078 CYTHON_NCP_UNUSED
int wraparound,
29079 CYTHON_NCP_UNUSED
int boundscheck) {
29080 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
29081 if (is_list || PyList_CheckExact(o)) {
29082 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
29083 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
29084 PyObject *r = PyList_GET_ITEM(o, n);
29089 else if (PyTuple_CheckExact(o)) {
29090 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
29091 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
29092 PyObject *r = PyTuple_GET_ITEM(o, n);
29097 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
29098 if (likely(m && m->sq_item)) {
29099 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
29100 Py_ssize_t l = m->sq_length(o);
29101 if (likely(l >= 0)) {
29104 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
29109 return m->sq_item(o, i);
29113 if (is_list || PySequence_Check(o)) {
29114 return PySequence_GetItem(o, i);
29117 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29121 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
29122 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
29124 value = PyDict_GetItemWithError(d, key);
29125 if (unlikely(!value)) {
29126 if (!PyErr_Occurred()) {
29127 if (unlikely(PyTuple_Check(key))) {
29128 PyObject* args = PyTuple_Pack(1, key);
29129 if (likely(args)) {
29130 PyErr_SetObject(PyExc_KeyError, args);
29134 PyErr_SetObject(PyExc_KeyError, key);
29146 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
29148 __Pyx_memviewslice *memviewslice,
29149 int memview_is_new_reference)
29151 __Pyx_RefNannyDeclarations
29153 Py_buffer *buf = &memview->view;
29154 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
29155 if (unlikely(memviewslice->memview || memviewslice->data)) {
29156 PyErr_SetString(PyExc_ValueError,
29157 "memviewslice is already initialized!");
29160 if (buf->strides) {
29161 for (i = 0; i < ndim; i++) {
29162 memviewslice->strides[i] = buf->strides[i];
29165 Py_ssize_t stride = buf->itemsize;
29166 for (i = ndim - 1; i >= 0; i--) {
29167 memviewslice->strides[i] = stride;
29168 stride *= buf->shape[i];
29171 for (i = 0; i < ndim; i++) {
29172 memviewslice->shape[i] = buf->shape[i];
29173 if (buf->suboffsets) {
29174 memviewslice->suboffsets[i] = buf->suboffsets[i];
29176 memviewslice->suboffsets[i] = -1;
29179 memviewslice->memview = memview;
29180 memviewslice->data = (
char *)buf->buf;
29181 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
29182 Py_INCREF(memview);
29187 memviewslice->memview = 0;
29188 memviewslice->data = 0;
29191 __Pyx_RefNannyFinishContext();
29194 #ifndef Py_NO_RETURN
29195 #define Py_NO_RETURN
29197 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
29200 #ifdef HAVE_STDARG_PROTOTYPES
29201 va_start(vargs, fmt);
29205 vsnprintf(msg, 200, fmt, vargs);
29207 Py_FatalError(msg);
29209 static CYTHON_INLINE
int
29210 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
29211 PyThread_type_lock lock)
29214 PyThread_acquire_lock(lock, 1);
29215 result = (*acquisition_count)++;
29216 PyThread_release_lock(lock);
29219 static CYTHON_INLINE
int
29220 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
29221 PyThread_type_lock lock)
29224 PyThread_acquire_lock(lock, 1);
29225 result = (*acquisition_count)--;
29226 PyThread_release_lock(lock);
29229 static CYTHON_INLINE
void
29230 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
29233 struct __pyx_memoryview_obj *memview = memslice->memview;
29234 if (unlikely(!memview || (PyObject *) memview == Py_None))
29236 if (unlikely(__pyx_get_slice_count(memview) < 0))
29237 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
29238 __pyx_get_slice_count(memview), lineno);
29239 first_time = __pyx_add_acquisition_count(memview) == 0;
29240 if (unlikely(first_time)) {
29242 Py_INCREF((PyObject *) memview);
29244 PyGILState_STATE _gilstate = PyGILState_Ensure();
29245 Py_INCREF((PyObject *) memview);
29246 PyGILState_Release(_gilstate);
29250 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
29251 int have_gil,
int lineno) {
29253 struct __pyx_memoryview_obj *memview = memslice->memview;
29254 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
29255 memslice->memview = NULL;
29258 if (unlikely(__pyx_get_slice_count(memview) <= 0))
29259 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
29260 __pyx_get_slice_count(memview), lineno);
29261 last_time = __pyx_sub_acquisition_count(memview) == 1;
29262 memslice->data = NULL;
29263 if (unlikely(last_time)) {
29265 Py_CLEAR(memslice->memview);
29267 PyGILState_STATE _gilstate = PyGILState_Ensure();
29268 Py_CLEAR(memslice->memview);
29269 PyGILState_Release(_gilstate);
29272 memslice->memview = NULL;
29277 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
29279 if (unlikely(!type)) {
29280 PyErr_SetString(PyExc_SystemError,
"Missing type object");
29284 #if PY_MAJOR_VERSION == 2
29285 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
29289 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
29291 PyErr_Format(PyExc_TypeError,
29292 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
29293 name, type->tp_name, Py_TYPE(obj)->tp_name);
29298 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
29299 #if CYTHON_COMPILING_IN_PYPY
29300 return PyObject_RichCompareBool(s1, s2, equals);
29302 #if PY_MAJOR_VERSION < 3
29303 PyObject* owned_ref = NULL;
29305 int s1_is_unicode, s2_is_unicode;
29309 s1_is_unicode = PyUnicode_CheckExact(s1);
29310 s2_is_unicode = PyUnicode_CheckExact(s2);
29311 #if PY_MAJOR_VERSION < 3
29312 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
29313 owned_ref = PyUnicode_FromObject(s2);
29314 if (unlikely(!owned_ref))
29318 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
29319 owned_ref = PyUnicode_FromObject(s1);
29320 if (unlikely(!owned_ref))
29324 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
29325 return __Pyx_PyBytes_Equals(s1, s2, equals);
29328 if (s1_is_unicode & s2_is_unicode) {
29331 void *data1, *data2;
29332 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
29334 length = __Pyx_PyUnicode_GET_LENGTH(s1);
29335 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
29338 #if CYTHON_USE_UNICODE_INTERNALS
29340 Py_hash_t hash1, hash2;
29341 #if CYTHON_PEP393_ENABLED
29342 hash1 = ((PyASCIIObject*)s1)->hash;
29343 hash2 = ((PyASCIIObject*)s2)->hash;
29345 hash1 = ((PyUnicodeObject*)s1)->hash;
29346 hash2 = ((PyUnicodeObject*)s2)->hash;
29348 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
29353 kind = __Pyx_PyUnicode_KIND(s1);
29354 if (kind != __Pyx_PyUnicode_KIND(s2)) {
29357 data1 = __Pyx_PyUnicode_DATA(s1);
29358 data2 = __Pyx_PyUnicode_DATA(s2);
29359 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
29361 }
else if (length == 1) {
29364 int result = memcmp(data1, data2, (
size_t)(length * kind));
29365 #if PY_MAJOR_VERSION < 3
29366 Py_XDECREF(owned_ref);
29368 return (equals == Py_EQ) ? (result == 0) : (result != 0);
29370 }
else if ((s1 == Py_None) & s2_is_unicode) {
29372 }
else if ((s2 == Py_None) & s1_is_unicode) {
29376 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
29377 #if PY_MAJOR_VERSION < 3
29378 Py_XDECREF(owned_ref);
29382 result = __Pyx_PyObject_IsTrue(py_result);
29383 Py_DECREF(py_result);
29387 #if PY_MAJOR_VERSION < 3
29388 Py_XDECREF(owned_ref);
29390 return (equals == Py_EQ);
29392 #if PY_MAJOR_VERSION < 3
29393 Py_XDECREF(owned_ref);
29395 return (equals == Py_NE);
29400 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
29401 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
29402 int full_traceback, CYTHON_UNUSED
int nogil) {
29403 PyObject *old_exc, *old_val, *old_tb;
29405 __Pyx_PyThreadState_declare
29407 PyGILState_STATE state;
29409 state = PyGILState_Ensure();
29411 else state = (PyGILState_STATE)-1;
29414 __Pyx_PyThreadState_assign
29415 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
29416 if (full_traceback) {
29417 Py_XINCREF(old_exc);
29418 Py_XINCREF(old_val);
29419 Py_XINCREF(old_tb);
29420 __Pyx_ErrRestore(old_exc, old_val, old_tb);
29423 #if PY_MAJOR_VERSION < 3
29424 ctx = PyString_FromString(name);
29426 ctx = PyUnicode_FromString(name);
29428 __Pyx_ErrRestore(old_exc, old_val, old_tb);
29430 PyErr_WriteUnraisable(Py_None);
29432 PyErr_WriteUnraisable(ctx);
29437 PyGILState_Release(state);
29442 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
29443 #if CYTHON_USE_TYPE_SLOTS
29444 #if PY_MAJOR_VERSION >= 3
29445 if (likely(PyUnicode_Check(n)))
29447 if (likely(PyString_Check(n)))
29449 return __Pyx_PyObject_GetAttrStr(o, n);
29451 return PyObject_GetAttr(o, n);
29455 #if CYTHON_USE_TYPE_SLOTS
29456 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
29458 Py_ssize_t key_value;
29459 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
29460 if (unlikely(!(m && m->sq_item))) {
29461 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
29464 key_value = __Pyx_PyIndex_AsSsize_t(index);
29465 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
29466 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
29468 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
29470 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
29474 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
29475 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
29476 if (likely(m && m->mp_subscript)) {
29477 return m->mp_subscript(obj, key);
29479 return __Pyx_PyObject_GetIndex(obj, key);
29484 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
29485 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
29486 const char* encoding,
const char* errors,
29487 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
29489 if (unlikely((start < 0) | (stop < 0))) {
29490 size_t slen = strlen(cstring);
29491 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
29492 PyErr_SetString(PyExc_OverflowError,
29493 "c-string too long to convert to Python");
29496 length = (Py_ssize_t) slen;
29505 if (unlikely(stop <= start))
29506 return __Pyx_NewRef(__pyx_empty_unicode);
29507 length = stop - start;
29510 return decode_func(cstring, length, errors);
29512 return PyUnicode_Decode(cstring, length, encoding, errors);
29517 #if CYTHON_FAST_THREAD_STATE
29518 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
29520 n = PyTuple_GET_SIZE(tuple);
29521 #if PY_MAJOR_VERSION >= 3
29522 for (i=0; i<n; i++) {
29523 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
29526 for (i=0; i<n; i++) {
29527 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
29531 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
29532 PyObject *exc_type = tstate->curexc_type;
29533 if (exc_type == err)
return 1;
29534 if (unlikely(!exc_type))
return 0;
29535 if (unlikely(PyTuple_Check(err)))
29536 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
29537 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
29542 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
29543 __Pyx_PyThreadState_declare
29544 __Pyx_PyThreadState_assign
29545 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
29547 __Pyx_PyErr_Clear();
29551 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
29552 PyObject *r = __Pyx_GetAttr(o, n);
29553 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
29557 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
29558 PyErr_Format(PyExc_ValueError,
29559 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
29563 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
29564 PyErr_Format(PyExc_ValueError,
29565 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
29566 index, (index == 1) ?
"" :
"s");
29570 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
29571 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
29575 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
29576 if (unlikely(!type)) {
29577 PyErr_SetString(PyExc_SystemError,
"Missing type object");
29580 if (likely(__Pyx_TypeCheck(obj, type)))
29582 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
29583 Py_TYPE(obj)->tp_name, type->tp_name);
29588 #if CYTHON_USE_EXC_INFO_STACK
29589 static _PyErr_StackItem *
29590 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
29592 _PyErr_StackItem *exc_info = tstate->exc_info;
29593 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
29594 exc_info->previous_item != NULL)
29596 exc_info = exc_info->previous_item;
29603 #if CYTHON_FAST_THREAD_STATE
29604 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29605 #if CYTHON_USE_EXC_INFO_STACK
29606 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
29607 *type = exc_info->exc_type;
29608 *value = exc_info->exc_value;
29609 *tb = exc_info->exc_traceback;
29611 *type = tstate->exc_type;
29612 *value = tstate->exc_value;
29613 *tb = tstate->exc_traceback;
29616 Py_XINCREF(*value);
29619 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
29620 PyObject *tmp_type, *tmp_value, *tmp_tb;
29621 #if CYTHON_USE_EXC_INFO_STACK
29622 _PyErr_StackItem *exc_info = tstate->exc_info;
29623 tmp_type = exc_info->exc_type;
29624 tmp_value = exc_info->exc_value;
29625 tmp_tb = exc_info->exc_traceback;
29626 exc_info->exc_type = type;
29627 exc_info->exc_value = value;
29628 exc_info->exc_traceback = tb;
29630 tmp_type = tstate->exc_type;
29631 tmp_value = tstate->exc_value;
29632 tmp_tb = tstate->exc_traceback;
29633 tstate->exc_type = type;
29634 tstate->exc_value = value;
29635 tstate->exc_traceback = tb;
29637 Py_XDECREF(tmp_type);
29638 Py_XDECREF(tmp_value);
29639 Py_XDECREF(tmp_tb);
29644 #if CYTHON_FAST_THREAD_STATE
29645 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
29647 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
29650 PyObject *local_type, *local_value, *local_tb;
29651 #if CYTHON_FAST_THREAD_STATE
29652 PyObject *tmp_type, *tmp_value, *tmp_tb;
29653 local_type = tstate->curexc_type;
29654 local_value = tstate->curexc_value;
29655 local_tb = tstate->curexc_traceback;
29656 tstate->curexc_type = 0;
29657 tstate->curexc_value = 0;
29658 tstate->curexc_traceback = 0;
29660 PyErr_Fetch(&local_type, &local_value, &local_tb);
29662 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
29663 #if CYTHON_FAST_THREAD_STATE
29664 if (unlikely(tstate->curexc_type))
29666 if (unlikely(PyErr_Occurred()))
29669 #if PY_MAJOR_VERSION >= 3
29671 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
29675 Py_XINCREF(local_tb);
29676 Py_XINCREF(local_type);
29677 Py_XINCREF(local_value);
29678 *type = local_type;
29679 *value = local_value;
29681 #if CYTHON_FAST_THREAD_STATE
29682 #if CYTHON_USE_EXC_INFO_STACK
29684 _PyErr_StackItem *exc_info = tstate->exc_info;
29685 tmp_type = exc_info->exc_type;
29686 tmp_value = exc_info->exc_value;
29687 tmp_tb = exc_info->exc_traceback;
29688 exc_info->exc_type = local_type;
29689 exc_info->exc_value = local_value;
29690 exc_info->exc_traceback = local_tb;
29693 tmp_type = tstate->exc_type;
29694 tmp_value = tstate->exc_value;
29695 tmp_tb = tstate->exc_traceback;
29696 tstate->exc_type = local_type;
29697 tstate->exc_value = local_value;
29698 tstate->exc_traceback = local_tb;
29700 Py_XDECREF(tmp_type);
29701 Py_XDECREF(tmp_value);
29702 Py_XDECREF(tmp_tb);
29704 PyErr_SetExcInfo(local_type, local_value, local_tb);
29711 Py_XDECREF(local_type);
29712 Py_XDECREF(local_value);
29713 Py_XDECREF(local_tb);
29718 #if CYTHON_FAST_THREAD_STATE
29719 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29720 PyObject *tmp_type, *tmp_value, *tmp_tb;
29721 #if CYTHON_USE_EXC_INFO_STACK
29722 _PyErr_StackItem *exc_info = tstate->exc_info;
29723 tmp_type = exc_info->exc_type;
29724 tmp_value = exc_info->exc_value;
29725 tmp_tb = exc_info->exc_traceback;
29726 exc_info->exc_type = *type;
29727 exc_info->exc_value = *value;
29728 exc_info->exc_traceback = *tb;
29730 tmp_type = tstate->exc_type;
29731 tmp_value = tstate->exc_value;
29732 tmp_tb = tstate->exc_traceback;
29733 tstate->exc_type = *type;
29734 tstate->exc_value = *value;
29735 tstate->exc_traceback = *tb;
29738 *value = tmp_value;
29742 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
29743 PyObject *tmp_type, *tmp_value, *tmp_tb;
29744 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
29745 PyErr_SetExcInfo(*type, *value, *tb);
29747 *value = tmp_value;
29753 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
29754 PyObject *empty_list = 0;
29755 PyObject *module = 0;
29756 PyObject *global_dict = 0;
29757 PyObject *empty_dict = 0;
29759 #if PY_MAJOR_VERSION < 3
29760 PyObject *py_import;
29761 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
29768 empty_list = PyList_New(0);
29773 global_dict = PyModule_GetDict(__pyx_m);
29776 empty_dict = PyDict_New();
29780 #if PY_MAJOR_VERSION >= 3
29782 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
29783 module = PyImport_ImportModuleLevelObject(
29784 name, global_dict, empty_dict, list, 1);
29786 if (!PyErr_ExceptionMatches(PyExc_ImportError))
29795 #if PY_MAJOR_VERSION < 3
29796 PyObject *py_level = PyInt_FromLong(level);
29799 module = PyObject_CallFunctionObjArgs(py_import,
29800 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
29801 Py_DECREF(py_level);
29803 module = PyImport_ImportModuleLevelObject(
29804 name, global_dict, empty_dict, list, level);
29809 #if PY_MAJOR_VERSION < 3
29810 Py_XDECREF(py_import);
29812 Py_XDECREF(empty_list);
29813 Py_XDECREF(empty_dict);
29818 #if CYTHON_COMPILING_IN_CPYTHON
29819 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
29825 return b == &PyBaseObject_Type;
29827 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
29829 if (a == b)
return 1;
29833 n = PyTuple_GET_SIZE(mro);
29834 for (i = 0; i < n; i++) {
29835 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
29840 return __Pyx_InBases(a, b);
29842 #if PY_MAJOR_VERSION == 2
29843 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
29844 PyObject *exception, *value, *tb;
29846 __Pyx_PyThreadState_declare
29847 __Pyx_PyThreadState_assign
29848 __Pyx_ErrFetch(&exception, &value, &tb);
29849 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
29850 if (unlikely(res == -1)) {
29851 PyErr_WriteUnraisable(err);
29855 res = PyObject_IsSubclass(err, exc_type2);
29856 if (unlikely(res == -1)) {
29857 PyErr_WriteUnraisable(err);
29861 __Pyx_ErrRestore(exception, value, tb);
29865 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
29866 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
29868 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
29873 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
29875 assert(PyExceptionClass_Check(exc_type));
29876 n = PyTuple_GET_SIZE(tuple);
29877 #if PY_MAJOR_VERSION >= 3
29878 for (i=0; i<n; i++) {
29879 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
29882 for (i=0; i<n; i++) {
29883 PyObject *t = PyTuple_GET_ITEM(tuple, i);
29884 #if PY_MAJOR_VERSION < 3
29885 if (likely(exc_type == t))
return 1;
29887 if (likely(PyExceptionClass_Check(t))) {
29888 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
29894 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
29895 if (likely(err == exc_type))
return 1;
29896 if (likely(PyExceptionClass_Check(err))) {
29897 if (likely(PyExceptionClass_Check(exc_type))) {
29898 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
29899 }
else if (likely(PyTuple_Check(exc_type))) {
29900 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
29904 return PyErr_GivenExceptionMatches(err, exc_type);
29906 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
29907 assert(PyExceptionClass_Check(exc_type1));
29908 assert(PyExceptionClass_Check(exc_type2));
29909 if (likely(err == exc_type1 || err == exc_type2))
return 1;
29910 if (likely(PyExceptionClass_Check(err))) {
29911 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
29913 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
29918 #if !CYTHON_COMPILING_IN_PYPY
29919 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
29921 (void)zerodivision_check;
29922 #if PY_MAJOR_VERSION < 3
29923 if (likely(PyInt_CheckExact(op1))) {
29924 const long b = intval;
29926 long a = PyInt_AS_LONG(op1);
29927 x = (long)((
unsigned long)a + b);
29928 if (likely((x^a) >= 0 || (x^b) >= 0))
29929 return PyInt_FromLong(x);
29930 return PyLong_Type.tp_as_number->nb_add(op1, op2);
29933 #if CYTHON_USE_PYLONG_INTERNALS
29934 if (likely(PyLong_CheckExact(op1))) {
29935 const long b = intval;
29937 #ifdef HAVE_LONG_LONG
29938 const PY_LONG_LONG llb = intval;
29939 PY_LONG_LONG lla, llx;
29941 const digit* digits = ((PyLongObject*)op1)->ob_digit;
29942 const Py_ssize_t size = Py_SIZE(op1);
29943 if (likely(__Pyx_sst_abs(size) <= 1)) {
29944 a = likely(size) ? digits[0] : 0;
29945 if (size == -1) a = -a;
29949 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
29950 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
29952 #ifdef HAVE_LONG_LONG
29953 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
29954 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
29958 CYTHON_FALLTHROUGH;
29960 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
29961 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
29963 #ifdef HAVE_LONG_LONG
29964 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
29965 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
29969 CYTHON_FALLTHROUGH;
29971 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
29972 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
29974 #ifdef HAVE_LONG_LONG
29975 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
29976 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
29980 CYTHON_FALLTHROUGH;
29982 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
29983 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
29985 #ifdef HAVE_LONG_LONG
29986 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
29987 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
29991 CYTHON_FALLTHROUGH;
29993 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
29994 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
29996 #ifdef HAVE_LONG_LONG
29997 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
29998 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
30002 CYTHON_FALLTHROUGH;
30004 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
30005 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
30007 #ifdef HAVE_LONG_LONG
30008 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30009 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
30013 CYTHON_FALLTHROUGH;
30014 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
30018 return PyLong_FromLong(x);
30019 #ifdef HAVE_LONG_LONG
30022 return PyLong_FromLongLong(llx);
30028 if (PyFloat_CheckExact(op1)) {
30029 const long b = intval;
30030 double a = PyFloat_AS_DOUBLE(op1);
30032 PyFPE_START_PROTECT(
"add",
return NULL)
30033 result = ((double)a) + (double)b;
30034 PyFPE_END_PROTECT(result)
30035 return PyFloat_FromDouble(result);
30037 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
30042 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
30043 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
30047 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
30048 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
30049 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
30050 PyErr_Format(PyExc_ImportError,
30051 #
if PY_MAJOR_VERSION < 3
30052 "cannot import name %.230s", PyString_AS_STRING(name));
30054 "cannot import name %S", name);
30061 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *n) {
30063 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
30064 PyErr_SetString(PyExc_TypeError,
30065 "hasattr(): attribute name must be string");
30068 r = __Pyx_GetAttr(o, n);
30069 if (unlikely(!r)) {
30079 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
30080 PyTypeObject* type = Py_TYPE(obj);
30081 while (type && type->tp_dealloc != current_tp_dealloc)
30082 type = type->tp_base;
30083 while (type && type->tp_dealloc == current_tp_dealloc)
30084 type = type->tp_base;
30086 type->tp_dealloc(obj);
30090 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v,
void *a, traverseproc current_tp_traverse) {
30091 PyTypeObject* type = Py_TYPE(obj);
30092 while (type && type->tp_traverse != current_tp_traverse)
30093 type = type->tp_base;
30094 while (type && type->tp_traverse == current_tp_traverse)
30095 type = type->tp_base;
30096 if (type && type->tp_traverse)
30097 return type->tp_traverse(obj, v, a);
30102 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
30103 PyTypeObject* type = Py_TYPE(obj);
30104 while (type && type->tp_clear != current_tp_clear)
30105 type = type->tp_base;
30106 while (type && type->tp_clear == current_tp_clear)
30107 type = type->tp_base;
30108 if (type && type->tp_clear)
30109 type->tp_clear(obj);
30113 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30114 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
30115 PyErr_Format(PyExc_AttributeError,
30116 #
if PY_MAJOR_VERSION >= 3
30117 "'%.50s' object has no attribute '%U'",
30118 tp->tp_name, attr_name);
30120 "'%.50s' object has no attribute '%.400s'",
30121 tp->tp_name, PyString_AS_STRING(attr_name));
30125 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
30127 PyTypeObject *tp = Py_TYPE(obj);
30128 if (unlikely(!PyString_Check(attr_name))) {
30129 return PyObject_GenericGetAttr(obj, attr_name);
30131 assert(!tp->tp_dictoffset);
30132 descr = _PyType_Lookup(tp, attr_name);
30133 if (unlikely(!descr)) {
30134 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
30137 #if PY_MAJOR_VERSION < 3
30138 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
30141 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
30143 PyObject *res = f(descr, obj, (PyObject *)tp);
30153 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30154 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
30155 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
30156 return PyObject_GenericGetAttr(obj, attr_name);
30158 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
30163 #ifndef __PYX_HAVE_RT_ImportType
30164 #define __PYX_HAVE_RT_ImportType
30165 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
30166 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
30168 PyObject *result = 0;
30170 Py_ssize_t basicsize;
30171 #ifdef Py_LIMITED_API
30172 PyObject *py_basicsize;
30174 result = PyObject_GetAttrString(module, class_name);
30177 if (!PyType_Check(result)) {
30178 PyErr_Format(PyExc_TypeError,
30179 "%.200s.%.200s is not a type object",
30180 module_name, class_name);
30183 #ifndef Py_LIMITED_API
30184 basicsize = ((PyTypeObject *)result)->tp_basicsize;
30186 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
30189 basicsize = PyLong_AsSsize_t(py_basicsize);
30190 Py_DECREF(py_basicsize);
30192 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
30195 if ((
size_t)basicsize < size) {
30196 PyErr_Format(PyExc_ValueError,
30197 "%.200s.%.200s size changed, may indicate binary incompatibility. "
30198 "Expected %zd from C header, got %zd from PyObject",
30199 module_name, class_name, size, basicsize);
30202 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
30203 PyErr_Format(PyExc_ValueError,
30204 "%.200s.%.200s size changed, may indicate binary incompatibility. "
30205 "Expected %zd from C header, got %zd from PyObject",
30206 module_name, class_name, size, basicsize);
30209 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
30210 PyOS_snprintf(warning,
sizeof(warning),
30211 "%s.%s size changed, may indicate binary incompatibility. "
30212 "Expected %zd from C header, got %zd from PyObject",
30213 module_name, class_name, size, basicsize);
30214 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
30216 return (PyTypeObject *)result;
30218 Py_XDECREF(result);
30224 static void* __Pyx_GetVtable(PyObject *dict) {
30226 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
30229 #if PY_VERSION_HEX >= 0x02070000
30230 ptr = PyCapsule_GetPointer(ob, 0);
30232 ptr = PyCObject_AsVoidPtr(ob);
30234 if (!ptr && !PyErr_Occurred())
30235 PyErr_SetString(PyExc_RuntimeError,
"invalid vtable found for imported type");
30244 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
30245 #if PY_VERSION_HEX >= 0x02070000
30246 PyObject *ob = PyCapsule_New(vtable, 0, 0);
30248 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
30252 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
30262 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
30263 __Pyx_PyThreadState_declare
30264 __Pyx_PyThreadState_assign
30265 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
30266 __Pyx_PyErr_Clear();
30268 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
30270 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
30271 PyTypeObject* tp = Py_TYPE(obj);
30272 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
30273 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
30276 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
30277 if (unlikely(!result)) {
30278 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
30284 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
30286 PyObject *name_attr;
30287 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
30288 if (likely(name_attr)) {
30289 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
30293 if (unlikely(ret < 0)) {
30297 Py_XDECREF(name_attr);
30300 static int __Pyx_setup_reduce(PyObject* type_obj) {
30302 PyObject *object_reduce = NULL;
30303 PyObject *object_reduce_ex = NULL;
30304 PyObject *reduce = NULL;
30305 PyObject *reduce_ex = NULL;
30306 PyObject *reduce_cython = NULL;
30307 PyObject *setstate = NULL;
30308 PyObject *setstate_cython = NULL;
30309 #if CYTHON_USE_PYTYPE_LOOKUP
30310 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
30312 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
30314 #if CYTHON_USE_PYTYPE_LOOKUP
30315 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
30317 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
30319 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
30320 if (reduce_ex == object_reduce_ex) {
30321 #if CYTHON_USE_PYTYPE_LOOKUP
30322 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
30324 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
30326 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
30327 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
30328 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
30329 if (likely(reduce_cython)) {
30330 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
30331 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
30332 }
else if (reduce == object_reduce || PyErr_Occurred()) {
30335 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
30336 if (!setstate) PyErr_Clear();
30337 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
30338 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
30339 if (likely(setstate_cython)) {
30340 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
30341 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
30342 }
else if (!setstate || PyErr_Occurred()) {
30346 PyType_Modified((PyTypeObject*)type_obj);
30351 if (!PyErr_Occurred())
30352 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
30355 #if !CYTHON_USE_PYTYPE_LOOKUP
30356 Py_XDECREF(object_reduce);
30357 Py_XDECREF(object_reduce_ex);
30359 Py_XDECREF(reduce);
30360 Py_XDECREF(reduce_ex);
30361 Py_XDECREF(reduce_cython);
30362 Py_XDECREF(setstate);
30363 Py_XDECREF(setstate_cython);
30368 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
30369 PyObject* fake_module;
30370 PyTypeObject* cached_type = NULL;
30371 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
30372 if (!fake_module)
return NULL;
30373 Py_INCREF(fake_module);
30374 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
30376 if (!PyType_Check((PyObject*)cached_type)) {
30377 PyErr_Format(PyExc_TypeError,
30378 "Shared Cython type %.200s is not a type object",
30382 if (cached_type->tp_basicsize != type->tp_basicsize) {
30383 PyErr_Format(PyExc_TypeError,
30384 "Shared Cython type %.200s has the wrong size, try recompiling",
30389 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
30391 if (PyType_Ready(type) < 0)
goto bad;
30392 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
30395 cached_type = type;
30398 Py_DECREF(fake_module);
30399 return cached_type;
30401 Py_XDECREF(cached_type);
30402 cached_type = NULL;
30407 #include <structmember.h>
30409 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
30411 if (unlikely(op->func_doc == NULL)) {
30412 if (op->func.m_ml->ml_doc) {
30413 #if PY_MAJOR_VERSION >= 3
30414 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
30416 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
30418 if (unlikely(op->func_doc == NULL))
30421 Py_INCREF(Py_None);
30425 Py_INCREF(op->func_doc);
30426 return op->func_doc;
30429 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
30431 PyObject *tmp = op->func_doc;
30432 if (value == NULL) {
30436 op->func_doc = value;
30441 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
30443 if (unlikely(op->func_name == NULL)) {
30444 #if PY_MAJOR_VERSION >= 3
30445 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
30447 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
30449 if (unlikely(op->func_name == NULL))
30452 Py_INCREF(op->func_name);
30453 return op->func_name;
30456 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
30459 #if PY_MAJOR_VERSION >= 3
30460 if (unlikely(value == NULL || !PyUnicode_Check(value)))
30462 if (unlikely(value == NULL || !PyString_Check(value)))
30465 PyErr_SetString(PyExc_TypeError,
30466 "__name__ must be set to a string object");
30469 tmp = op->func_name;
30471 op->func_name = value;
30476 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
30478 Py_INCREF(op->func_qualname);
30479 return op->func_qualname;
30482 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
30485 #if PY_MAJOR_VERSION >= 3
30486 if (unlikely(value == NULL || !PyUnicode_Check(value)))
30488 if (unlikely(value == NULL || !PyString_Check(value)))
30491 PyErr_SetString(PyExc_TypeError,
30492 "__qualname__ must be set to a string object");
30495 tmp = op->func_qualname;
30497 op->func_qualname = value;
30502 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
30505 self = m->func_closure;
30512 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
30514 if (unlikely(op->func_dict == NULL)) {
30515 op->func_dict = PyDict_New();
30516 if (unlikely(op->func_dict == NULL))
30519 Py_INCREF(op->func_dict);
30520 return op->func_dict;
30523 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
30526 if (unlikely(value == NULL)) {
30527 PyErr_SetString(PyExc_TypeError,
30528 "function's dictionary may not be deleted");
30531 if (unlikely(!PyDict_Check(value))) {
30532 PyErr_SetString(PyExc_TypeError,
30533 "setting function's dictionary to a non-dict");
30536 tmp = op->func_dict;
30538 op->func_dict = value;
30543 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
30545 Py_INCREF(op->func_globals);
30546 return op->func_globals;
30549 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
30551 Py_INCREF(Py_None);
30555 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
30557 PyObject* result = (op->func_code) ? op->func_code : Py_None;
30562 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
30564 PyObject *res = op->defaults_getter((PyObject *) op);
30565 if (unlikely(!res))
30567 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30568 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
30569 Py_INCREF(op->defaults_tuple);
30570 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
30571 Py_INCREF(op->defaults_kwdict);
30573 op->defaults_tuple = PySequence_ITEM(res, 0);
30574 if (unlikely(!op->defaults_tuple)) result = -1;
30576 op->defaults_kwdict = PySequence_ITEM(res, 1);
30577 if (unlikely(!op->defaults_kwdict)) result = -1;
30584 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
30588 }
else if (value != Py_None && !PyTuple_Check(value)) {
30589 PyErr_SetString(PyExc_TypeError,
30590 "__defaults__ must be set to a tuple object");
30594 tmp = op->defaults_tuple;
30595 op->defaults_tuple = value;
30600 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
30601 PyObject* result = op->defaults_tuple;
30602 if (unlikely(!result)) {
30603 if (op->defaults_getter) {
30604 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
30605 result = op->defaults_tuple;
30614 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
30618 }
else if (value != Py_None && !PyDict_Check(value)) {
30619 PyErr_SetString(PyExc_TypeError,
30620 "__kwdefaults__ must be set to a dict object");
30624 tmp = op->defaults_kwdict;
30625 op->defaults_kwdict = value;
30630 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
30631 PyObject* result = op->defaults_kwdict;
30632 if (unlikely(!result)) {
30633 if (op->defaults_getter) {
30634 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
30635 result = op->defaults_kwdict;
30644 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
30646 if (!value || value == Py_None) {
30648 }
else if (!PyDict_Check(value)) {
30649 PyErr_SetString(PyExc_TypeError,
30650 "__annotations__ must be set to a dict object");
30654 tmp = op->func_annotations;
30655 op->func_annotations = value;
30660 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
30661 PyObject* result = op->func_annotations;
30662 if (unlikely(!result)) {
30663 result = PyDict_New();
30664 if (unlikely(!result))
return NULL;
30665 op->func_annotations = result;
30670 static PyGetSetDef __pyx_CyFunction_getsets[] = {
30671 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
30672 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
30673 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
30674 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
30675 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
30676 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
30677 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
30678 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
30679 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
30680 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
30681 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
30682 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
30683 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
30684 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
30685 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
30686 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
30687 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
30688 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
30691 static PyMemberDef __pyx_CyFunction_members[] = {
30692 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
30696 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
30698 #if PY_MAJOR_VERSION >= 3
30699 Py_INCREF(m->func_qualname);
30700 return m->func_qualname;
30702 return PyString_FromString(m->func.m_ml->ml_name);
30705 static PyMethodDef __pyx_CyFunction_methods[] = {
30706 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
30709 #if PY_VERSION_HEX < 0x030500A0
30710 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
30712 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
30714 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
30715 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
30716 if (unlikely(op == NULL))
30719 __Pyx_CyFunction_weakreflist(op) = NULL;
30720 op->func.m_ml = ml;
30721 op->func.m_self = (PyObject *) op;
30722 Py_XINCREF(closure);
30723 op->func_closure = closure;
30724 Py_XINCREF(module);
30725 op->func.m_module = module;
30726 op->func_dict = NULL;
30727 op->func_name = NULL;
30728 Py_INCREF(qualname);
30729 op->func_qualname = qualname;
30730 op->func_doc = NULL;
30731 op->func_classobj = NULL;
30732 op->func_globals = globals;
30733 Py_INCREF(op->func_globals);
30735 op->func_code = code;
30736 op->defaults_pyobjects = 0;
30737 op->defaults_size = 0;
30738 op->defaults = NULL;
30739 op->defaults_tuple = NULL;
30740 op->defaults_kwdict = NULL;
30741 op->defaults_getter = NULL;
30742 op->func_annotations = NULL;
30743 return (PyObject *) op;
30746 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
30748 Py_CLEAR(m->func_closure);
30749 Py_CLEAR(m->func.m_module);
30750 Py_CLEAR(m->func_dict);
30751 Py_CLEAR(m->func_name);
30752 Py_CLEAR(m->func_qualname);
30753 Py_CLEAR(m->func_doc);
30754 Py_CLEAR(m->func_globals);
30755 Py_CLEAR(m->func_code);
30756 Py_CLEAR(m->func_classobj);
30757 Py_CLEAR(m->defaults_tuple);
30758 Py_CLEAR(m->defaults_kwdict);
30759 Py_CLEAR(m->func_annotations);
30761 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
30763 for (i = 0; i < m->defaults_pyobjects; i++)
30764 Py_XDECREF(pydefaults[i]);
30765 PyObject_Free(m->defaults);
30766 m->defaults = NULL;
30770 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
30772 if (__Pyx_CyFunction_weakreflist(m) != NULL)
30773 PyObject_ClearWeakRefs((PyObject *) m);
30774 __Pyx_CyFunction_clear(m);
30775 PyObject_GC_Del(m);
30777 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
30779 PyObject_GC_UnTrack(m);
30780 __Pyx__CyFunction_dealloc(m);
30782 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
30784 Py_VISIT(m->func_closure);
30785 Py_VISIT(m->func.m_module);
30786 Py_VISIT(m->func_dict);
30787 Py_VISIT(m->func_name);
30788 Py_VISIT(m->func_qualname);
30789 Py_VISIT(m->func_doc);
30790 Py_VISIT(m->func_globals);
30791 Py_VISIT(m->func_code);
30792 Py_VISIT(m->func_classobj);
30793 Py_VISIT(m->defaults_tuple);
30794 Py_VISIT(m->defaults_kwdict);
30796 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
30798 for (i = 0; i < m->defaults_pyobjects; i++)
30799 Py_VISIT(pydefaults[i]);
30803 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
30805 #if PY_MAJOR_VERSION < 3
30806 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
30807 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
30811 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
30813 type = (PyObject *)(Py_TYPE(obj));
30814 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
30816 if (obj == Py_None)
30819 return __Pyx_PyMethod_New(func, obj, type);
30822 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
30824 #if PY_MAJOR_VERSION >= 3
30825 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
30826 op->func_qualname, (
void *)op);
30828 return PyString_FromFormat(
"<cyfunction %s at %p>",
30829 PyString_AsString(op->func_qualname), (
void *)op);
30832 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
30833 PyCFunctionObject* f = (PyCFunctionObject*)func;
30834 PyCFunction meth = f->m_ml->ml_meth;
30836 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
30838 if (likely(kw == NULL || PyDict_Size(kw) == 0))
30839 return (*meth)(
self, arg);
30841 case METH_VARARGS | METH_KEYWORDS:
30842 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
30844 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
30845 size = PyTuple_GET_SIZE(arg);
30846 if (likely(size == 0))
30847 return (*meth)(
self, NULL);
30848 PyErr_Format(PyExc_TypeError,
30849 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
30850 f->m_ml->ml_name, size);
30855 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
30856 size = PyTuple_GET_SIZE(arg);
30857 if (likely(size == 1)) {
30858 PyObject *result, *arg0;
30859 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30860 arg0 = PyTuple_GET_ITEM(arg, 0);
30862 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
30864 result = (*meth)(
self, arg0);
30865 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
30870 PyErr_Format(PyExc_TypeError,
30871 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
30872 f->m_ml->ml_name, size);
30877 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
30878 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
30879 "longer supported!");
30882 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
30886 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
30887 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
30889 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
30891 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
30892 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
30894 PyObject *new_args;
30896 argc = PyTuple_GET_SIZE(args);
30897 new_args = PyTuple_GetSlice(args, 1, argc);
30898 if (unlikely(!new_args))
30900 self = PyTuple_GetItem(args, 0);
30901 if (unlikely(!
self)) {
30902 Py_DECREF(new_args);
30905 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
30906 Py_DECREF(new_args);
30908 result = __Pyx_CyFunction_Call(func, args, kw);
30912 static PyTypeObject __pyx_CyFunctionType_type = {
30913 PyVarObject_HEAD_INIT(0, 0)
30914 "cython_function_or_method",
30915 sizeof(__pyx_CyFunctionObject),
30917 (destructor) __Pyx_CyFunction_dealloc,
30921 #if PY_MAJOR_VERSION < 3
30926 (reprfunc) __Pyx_CyFunction_repr,
30931 __Pyx_CyFunction_CallAsMethod,
30936 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
30938 (traverseproc) __Pyx_CyFunction_traverse,
30939 (inquiry) __Pyx_CyFunction_clear,
30941 #
if PY_VERSION_HEX < 0x030500A0
30942 offsetof(__pyx_CyFunctionObject, func_weakreflist),
30944 offsetof(PyCFunctionObject, m_weakreflist),
30948 __pyx_CyFunction_methods,
30949 __pyx_CyFunction_members,
30950 __pyx_CyFunction_getsets,
30953 __Pyx_CyFunction_descr_get,
30955 offsetof(__pyx_CyFunctionObject, func_dict),
30968 #if PY_VERSION_HEX >= 0x030400a1
30971 #if PY_VERSION_HEX >= 0x030800b1
30974 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
30978 static int __pyx_CyFunction_init(
void) {
30979 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
30980 if (unlikely(__pyx_CyFunctionType == NULL)) {
30985 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
30986 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
30987 m->defaults = PyObject_Malloc(size);
30988 if (unlikely(!m->defaults))
30989 return PyErr_NoMemory();
30990 memset(m->defaults, 0, size);
30991 m->defaults_pyobjects = pyobjects;
30992 m->defaults_size = size;
30993 return m->defaults;
30995 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
30996 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
30997 m->defaults_tuple = tuple;
31000 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
31001 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31002 m->defaults_kwdict = dict;
31005 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
31006 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31007 m->func_annotations = dict;
31012 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
31013 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
31014 PyObject *op = __Pyx_CyFunction_Init(
31015 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
31016 ml, flags, qualname, closure, module, globals, code
31019 PyObject_GC_Track(op);
31025 #ifndef CYTHON_CLINE_IN_TRACEBACK
31026 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
31027 PyObject *use_cline;
31028 PyObject *ptype, *pvalue, *ptraceback;
31029 #if CYTHON_COMPILING_IN_CPYTHON
31030 PyObject **cython_runtime_dict;
31032 if (unlikely(!__pyx_cython_runtime)) {
31035 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
31036 #if CYTHON_COMPILING_IN_CPYTHON
31037 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
31038 if (likely(cython_runtime_dict)) {
31039 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
31040 use_cline, *cython_runtime_dict,
31041 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
31045 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
31046 if (use_cline_obj) {
31047 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
31048 Py_DECREF(use_cline_obj);
31056 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
31058 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
31061 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
31067 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
31068 int start = 0, mid = 0, end = count - 1;
31069 if (end >= 0 && code_line > entries[end].code_line) {
31072 while (start < end) {
31073 mid = start + (end - start) / 2;
31074 if (code_line < entries[mid].code_line) {
31076 }
else if (code_line > entries[mid].code_line) {
31082 if (code_line <= entries[mid].code_line) {
31088 static PyCodeObject *__pyx_find_code_object(
int code_line) {
31089 PyCodeObject* code_object;
31091 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
31094 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
31095 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
31098 code_object = __pyx_code_cache.entries[pos].code_object;
31099 Py_INCREF(code_object);
31100 return code_object;
31102 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
31104 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
31105 if (unlikely(!code_line)) {
31108 if (unlikely(!entries)) {
31109 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
31110 if (likely(entries)) {
31111 __pyx_code_cache.entries = entries;
31112 __pyx_code_cache.max_count = 64;
31113 __pyx_code_cache.count = 1;
31114 entries[0].code_line = code_line;
31115 entries[0].code_object = code_object;
31116 Py_INCREF(code_object);
31120 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
31121 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
31122 PyCodeObject* tmp = entries[pos].code_object;
31123 entries[pos].code_object = code_object;
31127 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
31128 int new_max = __pyx_code_cache.max_count + 64;
31129 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
31130 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
31131 if (unlikely(!entries)) {
31134 __pyx_code_cache.entries = entries;
31135 __pyx_code_cache.max_count = new_max;
31137 for (i=__pyx_code_cache.count; i>pos; i--) {
31138 entries[i] = entries[i-1];
31140 entries[pos].code_line = code_line;
31141 entries[pos].code_object = code_object;
31142 __pyx_code_cache.count++;
31143 Py_INCREF(code_object);
31147 #include "compile.h"
31148 #include "frameobject.h"
31149 #include "traceback.h"
31150 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
31151 const char *funcname,
int c_line,
31152 int py_line,
const char *filename) {
31153 PyCodeObject *py_code = 0;
31154 PyObject *py_srcfile = 0;
31155 PyObject *py_funcname = 0;
31156 #if PY_MAJOR_VERSION < 3
31157 py_srcfile = PyString_FromString(filename);
31159 py_srcfile = PyUnicode_FromString(filename);
31161 if (!py_srcfile)
goto bad;
31163 #if PY_MAJOR_VERSION < 3
31164 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
31166 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
31170 #if PY_MAJOR_VERSION < 3
31171 py_funcname = PyString_FromString(funcname);
31173 py_funcname = PyUnicode_FromString(funcname);
31176 if (!py_funcname)
goto bad;
31177 py_code = __Pyx_PyCode_New(
31194 Py_DECREF(py_srcfile);
31195 Py_DECREF(py_funcname);
31198 Py_XDECREF(py_srcfile);
31199 Py_XDECREF(py_funcname);
31202 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
31203 int py_line,
const char *filename) {
31204 PyCodeObject *py_code = 0;
31205 PyFrameObject *py_frame = 0;
31206 PyThreadState *tstate = __Pyx_PyThreadState_Current;
31208 c_line = __Pyx_CLineForTraceback(tstate, c_line);
31210 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
31212 py_code = __Pyx_CreateCodeObjectForTraceback(
31213 funcname, c_line, py_line, filename);
31214 if (!py_code)
goto bad;
31215 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
31217 py_frame = PyFrame_New(
31223 if (!py_frame)
goto bad;
31224 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
31225 PyTraceBack_Here(py_frame);
31227 Py_XDECREF(py_code);
31228 Py_XDECREF(py_frame);
31231 #if PY_MAJOR_VERSION < 3
31232 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
31233 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
31234 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
31235 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
31236 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
31239 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
31240 PyObject *obj = view->obj;
31242 if (PyObject_CheckBuffer(obj)) {
31243 PyBuffer_Release(view);
31255 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
31257 int i, index, step, start;
31258 Py_ssize_t itemsize = mvs.memview->view.itemsize;
31259 if (order ==
'F') {
31266 for (i = 0; i < ndim; i++) {
31267 index = start + step * i;
31268 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
31270 itemsize *= mvs.shape[index];
31277 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
31278 void **out_start,
void **out_end,
31279 int ndim,
size_t itemsize)
31283 start = end = slice->data;
31284 for (i = 0; i < ndim; i++) {
31285 Py_ssize_t stride = slice->strides[i];
31286 Py_ssize_t extent = slice->shape[i];
31288 *out_start = *out_end = start;
31292 end += stride * (extent - 1);
31294 start += stride * (extent - 1);
31297 *out_start = start;
31298 *out_end = end + itemsize;
31301 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
31302 __Pyx_memviewslice *slice2,
31303 int ndim,
size_t itemsize)
31305 void *start1, *end1, *start2, *end2;
31306 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
31307 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
31308 return (start1 < end2) && (start2 < end1);
31312 static CYTHON_INLINE PyObject *
31313 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
31316 #if PY_VERSION_HEX >= 0x02070000
31317 cobj = PyCapsule_New(p, sig, NULL);
31319 cobj = PyCObject_FromVoidPtr(p, NULL);
31325 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
31326 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
31327 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
31328 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
31329 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
31331 func_type value = func_value;\
31332 if (sizeof(target_type) < sizeof(func_type)) {\
31333 if (unlikely(value != (func_type) (target_type) value)) {\
31334 func_type zero = 0;\
31335 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
31336 return (target_type) -1;\
31337 if (is_unsigned && unlikely(value < zero))\
31338 goto raise_neg_overflow;\
31340 goto raise_overflow;\
31343 return (target_type) value;\
31347 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
31353 S.u32 = 0x01020304;
31354 return S.u8[0] == 4;
31358 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
31359 __Pyx_BufFmt_StackElem* stack,
31360 __Pyx_TypeInfo* type) {
31361 stack[0].field = &ctx->root;
31362 stack[0].parent_offset = 0;
31363 ctx->root.type = type;
31364 ctx->root.name =
"buffer dtype";
31365 ctx->root.offset = 0;
31367 ctx->head->field = &ctx->root;
31368 ctx->fmt_offset = 0;
31369 ctx->head->parent_offset = 0;
31370 ctx->new_packmode =
'@';
31371 ctx->enc_packmode =
'@';
31372 ctx->new_count = 1;
31373 ctx->enc_count = 0;
31375 ctx->is_complex = 0;
31376 ctx->is_valid_array = 0;
31377 ctx->struct_alignment = 0;
31378 while (type->typegroup ==
'S') {
31380 ctx->head->field = type->fields;
31381 ctx->head->parent_offset = 0;
31382 type = type->fields->type;
31385 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
31387 const char* t = *ts;
31388 if (*t < '0' || *t >
'9') {
31391 count = *t++ -
'0';
31392 while (*t >=
'0' && *t <=
'9') {
31394 count += *t++ -
'0';
31400 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
31401 int number = __Pyx_BufFmt_ParseNumber(ts);
31403 PyErr_Format(PyExc_ValueError,\
31404 "Does not understand character buffer dtype format string ('%c')", **ts);
31407 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
31408 PyErr_Format(PyExc_ValueError,
31409 "Unexpected format string character: '%c'", ch);
31411 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
31413 case '?':
return "'bool'";
31414 case 'c':
return "'char'";
31415 case 'b':
return "'signed char'";
31416 case 'B':
return "'unsigned char'";
31417 case 'h':
return "'short'";
31418 case 'H':
return "'unsigned short'";
31419 case 'i':
return "'int'";
31420 case 'I':
return "'unsigned int'";
31421 case 'l':
return "'long'";
31422 case 'L':
return "'unsigned long'";
31423 case 'q':
return "'long long'";
31424 case 'Q':
return "'unsigned long long'";
31425 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
31426 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
31427 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
31428 case 'T':
return "a struct";
31429 case 'O':
return "Python object";
31430 case 'P':
return "a pointer";
31431 case 's':
case 'p':
return "a string";
31432 case 0:
return "end";
31433 default:
return "unparseable format string";
31436 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
31438 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
31439 case 'h':
case 'H':
return 2;
31440 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
31441 case 'q':
case 'Q':
return 8;
31442 case 'f':
return (is_complex ? 8 : 4);
31443 case 'd':
return (is_complex ? 16 : 8);
31445 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
31448 case 'O':
case 'P':
return sizeof(
void*);
31450 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31454 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
31456 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
31457 case 'h':
case 'H':
return sizeof(short);
31458 case 'i':
case 'I':
return sizeof(int);
31459 case 'l':
case 'L':
return sizeof(long);
31460 #ifdef HAVE_LONG_LONG
31461 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
31463 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
31464 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
31465 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
31466 case 'O':
case 'P':
return sizeof(
void*);
31468 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31473 typedef struct {
char c;
short x; } __Pyx_st_short;
31474 typedef struct {
char c;
int x; } __Pyx_st_int;
31475 typedef struct {
char c;
long x; } __Pyx_st_long;
31476 typedef struct {
char c;
float x; } __Pyx_st_float;
31477 typedef struct {
char c;
double x; } __Pyx_st_double;
31478 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
31479 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
31480 #ifdef HAVE_LONG_LONG
31481 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
31483 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
31485 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
31486 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
31487 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
31488 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
31489 #ifdef HAVE_LONG_LONG
31490 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
31492 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
31493 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
31494 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
31495 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
31497 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31505 typedef struct {
short x;
char c; } __Pyx_pad_short;
31506 typedef struct {
int x;
char c; } __Pyx_pad_int;
31507 typedef struct {
long x;
char c; } __Pyx_pad_long;
31508 typedef struct {
float x;
char c; } __Pyx_pad_float;
31509 typedef struct {
double x;
char c; } __Pyx_pad_double;
31510 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
31511 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
31512 #ifdef HAVE_LONG_LONG
31513 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
31515 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
31517 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
31518 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
31519 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
31520 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
31521 #ifdef HAVE_LONG_LONG
31522 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
31524 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
31525 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
31526 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
31527 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
31529 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31533 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
31537 case 'b':
case 'h':
case 'i':
31538 case 'l':
case 'q':
case 's':
case 'p':
31540 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
31542 case 'f':
case 'd':
case 'g':
31543 return (is_complex ?
'C' :
'R');
31549 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31554 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
31555 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
31556 const char* expected;
31558 if (ctx->head == NULL) {
31562 expected = ctx->head->field->type->name;
31565 PyErr_Format(PyExc_ValueError,
31566 "Buffer dtype mismatch, expected %s%s%s but got %s",
31567 quote, expected, quote,
31568 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
31570 __Pyx_StructField* field = ctx->head->field;
31571 __Pyx_StructField* parent = (ctx->head - 1)->field;
31572 PyErr_Format(PyExc_ValueError,
31573 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
31574 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
31575 parent->type->name, field->name);
31578 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
31580 size_t size, offset, arraysize = 1;
31581 if (ctx->enc_type == 0)
return 0;
31582 if (ctx->head->field->type->arraysize[0]) {
31584 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
31585 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
31587 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
31588 PyErr_Format(PyExc_ValueError,
31589 "Expected a dimension of size %zu, got %zu",
31590 ctx->head->field->type->arraysize[0], ctx->enc_count);
31594 if (!ctx->is_valid_array) {
31595 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
31596 ctx->head->field->type->ndim, ndim);
31599 for (i = 0; i < ctx->head->field->type->ndim; i++) {
31600 arraysize *= ctx->head->field->type->arraysize[i];
31602 ctx->is_valid_array = 0;
31603 ctx->enc_count = 1;
31605 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
31607 __Pyx_StructField* field = ctx->head->field;
31608 __Pyx_TypeInfo* type = field->type;
31609 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
31610 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
31612 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
31614 if (ctx->enc_packmode ==
'@') {
31615 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
31616 size_t align_mod_offset;
31617 if (align_at == 0)
return -1;
31618 align_mod_offset = ctx->fmt_offset % align_at;
31619 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
31620 if (ctx->struct_alignment == 0)
31621 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
31624 if (type->size != size || type->typegroup != group) {
31625 if (type->typegroup ==
'C' && type->fields != NULL) {
31626 size_t parent_offset = ctx->head->parent_offset + field->offset;
31628 ctx->head->field = type->fields;
31629 ctx->head->parent_offset = parent_offset;
31632 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
31634 __Pyx_BufFmt_RaiseExpected(ctx);
31638 offset = ctx->head->parent_offset + field->offset;
31639 if (ctx->fmt_offset != offset) {
31640 PyErr_Format(PyExc_ValueError,
31641 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
31642 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
31645 ctx->fmt_offset += size;
31647 ctx->fmt_offset += (arraysize - 1) * size;
31650 if (field == &ctx->root) {
31652 if (ctx->enc_count != 0) {
31653 __Pyx_BufFmt_RaiseExpected(ctx);
31658 ctx->head->field = ++field;
31659 if (field->type == NULL) {
31661 field = ctx->head->field;
31663 }
else if (field->type->typegroup ==
'S') {
31664 size_t parent_offset = ctx->head->parent_offset + field->offset;
31665 if (field->type->fields->type == NULL)
continue;
31666 field = field->type->fields;
31668 ctx->head->field = field;
31669 ctx->head->parent_offset = parent_offset;
31675 }
while (ctx->enc_count);
31677 ctx->is_complex = 0;
31681 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
31683 const char *ts = *tsp;
31684 int i = 0, number, ndim;
31686 if (ctx->new_count != 1) {
31687 PyErr_SetString(PyExc_ValueError,
31688 "Cannot handle repeated arrays in format string");
31691 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
31692 ndim = ctx->head->field->type->ndim;
31693 while (*ts && *ts !=
')') {
31695 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
31698 number = __Pyx_BufFmt_ExpectNumber(&ts);
31699 if (number == -1)
return NULL;
31700 if (i < ndim && (
size_t) number != ctx->head->field->type->arraysize[i])
31701 return PyErr_Format(PyExc_ValueError,
31702 "Expected a dimension of size %zu, got %d",
31703 ctx->head->field->type->arraysize[i], number);
31704 if (*ts !=
',' && *ts !=
')')
31705 return PyErr_Format(PyExc_ValueError,
31706 "Expected a comma in format string, got '%c'", *ts);
31707 if (*ts ==
',') ts++;
31711 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
31712 ctx->head->field->type->ndim, i);
31714 PyErr_SetString(PyExc_ValueError,
31715 "Unexpected end of format string, expected ')'");
31718 ctx->is_valid_array = 1;
31719 ctx->new_count = 1;
31723 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
31728 if (ctx->enc_type != 0 && ctx->head == NULL) {
31729 __Pyx_BufFmt_RaiseExpected(ctx);
31732 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
31733 if (ctx->head != NULL) {
31734 __Pyx_BufFmt_RaiseExpected(ctx);
31744 if (!__Pyx_Is_Little_Endian()) {
31745 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
31748 ctx->new_packmode =
'=';
31753 if (__Pyx_Is_Little_Endian()) {
31754 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
31757 ctx->new_packmode =
'=';
31763 ctx->new_packmode = *ts++;
31767 const char* ts_after_sub;
31768 size_t i, struct_count = ctx->new_count;
31769 size_t struct_alignment = ctx->struct_alignment;
31770 ctx->new_count = 1;
31773 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
31776 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
31778 ctx->enc_count = 0;
31779 ctx->struct_alignment = 0;
31782 for (i = 0; i != struct_count; ++i) {
31783 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
31784 if (!ts_after_sub)
return NULL;
31787 if (struct_alignment) ctx->struct_alignment = struct_alignment;
31792 size_t alignment = ctx->struct_alignment;
31794 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
31796 if (alignment && ctx->fmt_offset % alignment) {
31797 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
31802 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
31803 ctx->fmt_offset += ctx->new_count;
31804 ctx->new_count = 1;
31805 ctx->enc_count = 0;
31807 ctx->enc_packmode = ctx->new_packmode;
31813 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
31814 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
31817 CYTHON_FALLTHROUGH;
31818 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
31819 case 'l':
case 'L':
case 'q':
case 'Q':
31820 case 'f':
case 'd':
case 'g':
31821 case 'O':
case 'p':
31822 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
31823 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
31824 ctx->enc_count += ctx->new_count;
31825 ctx->new_count = 1;
31830 CYTHON_FALLTHROUGH;
31832 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
31833 ctx->enc_count = ctx->new_count;
31834 ctx->enc_packmode = ctx->new_packmode;
31835 ctx->enc_type = *ts;
31836 ctx->is_complex = got_Z;
31838 ctx->new_count = 1;
31843 while(*ts !=
':') ++ts;
31847 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
31851 int number = __Pyx_BufFmt_ExpectNumber(&ts);
31852 if (number == -1)
return NULL;
31853 ctx->new_count = (size_t)number;
31861 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
31868 if (a->size != b->size || a->typegroup != b->typegroup ||
31869 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
31870 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
31871 return a->size == b->size;
31877 for (i = 0; i < a->ndim; i++)
31878 if (a->arraysize[i] != b->arraysize[i])
31881 if (a->typegroup ==
'S') {
31882 if (a->flags != b->flags)
31884 if (a->fields || b->fields) {
31885 if (!(a->fields && b->fields))
31887 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
31888 __Pyx_StructField *field_a = a->fields + i;
31889 __Pyx_StructField *field_b = b->fields + i;
31890 if (field_a->offset != field_b->offset ||
31891 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
31894 return !a->fields[i].type && !b->fields[i].type;
31902 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
31904 if (buf->shape[dim] <= 1)
31906 if (buf->strides) {
31907 if (spec & __Pyx_MEMVIEW_CONTIG) {
31908 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
31909 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
31910 PyErr_Format(PyExc_ValueError,
31911 "Buffer is not indirectly contiguous "
31912 "in dimension %d.", dim);
31915 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
31916 PyErr_SetString(PyExc_ValueError,
31917 "Buffer and memoryview are not contiguous "
31918 "in the same dimension.");
31922 if (spec & __Pyx_MEMVIEW_FOLLOW) {
31923 Py_ssize_t stride = buf->strides[dim];
31926 if (unlikely(stride < buf->itemsize)) {
31927 PyErr_SetString(PyExc_ValueError,
31928 "Buffer and memoryview are not contiguous "
31929 "in the same dimension.");
31934 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
31935 PyErr_Format(PyExc_ValueError,
31936 "C-contiguous buffer is not contiguous in "
31937 "dimension %d", dim);
31939 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
31940 PyErr_Format(PyExc_ValueError,
31941 "C-contiguous buffer is not indirect in "
31942 "dimension %d", dim);
31944 }
else if (unlikely(buf->suboffsets)) {
31945 PyErr_SetString(PyExc_ValueError,
31946 "Buffer exposes suboffsets but no strides");
31955 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
31957 if (spec & __Pyx_MEMVIEW_DIRECT) {
31958 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
31959 PyErr_Format(PyExc_ValueError,
31960 "Buffer not compatible with direct access "
31961 "in dimension %d.", dim);
31965 if (spec & __Pyx_MEMVIEW_PTR) {
31966 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
31967 PyErr_Format(PyExc_ValueError,
31968 "Buffer is not indirectly accessible "
31969 "in dimension %d.", dim);
31978 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
31981 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
31982 Py_ssize_t stride = 1;
31983 for (i = 0; i < ndim; i++) {
31984 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
31985 PyErr_SetString(PyExc_ValueError,
31986 "Buffer not fortran contiguous.");
31989 stride = stride * buf->shape[i];
31991 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
31992 Py_ssize_t stride = 1;
31993 for (i = ndim - 1; i >- 1; i--) {
31994 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
31995 PyErr_SetString(PyExc_ValueError,
31996 "Buffer not C contiguous.");
31999 stride = stride * buf->shape[i];
32006 static int __Pyx_ValidateAndInit_memviewslice(
32011 __Pyx_TypeInfo *dtype,
32012 __Pyx_BufFmt_StackElem stack[],
32013 __Pyx_memviewslice *memviewslice,
32014 PyObject *original_obj)
32016 struct __pyx_memoryview_obj *memview, *new_memview;
32017 __Pyx_RefNannyDeclarations
32019 int i, spec = 0, retval = -1;
32020 __Pyx_BufFmt_Context ctx;
32021 int from_memoryview = __pyx_memoryview_check(original_obj);
32022 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
32023 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
32024 original_obj)->typeinfo)) {
32025 memview = (
struct __pyx_memoryview_obj *) original_obj;
32026 new_memview = NULL;
32028 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
32029 original_obj, buf_flags, 0, dtype);
32030 new_memview = memview;
32031 if (unlikely(!memview))
32034 buf = &memview->view;
32035 if (unlikely(buf->ndim != ndim)) {
32036 PyErr_Format(PyExc_ValueError,
32037 "Buffer has wrong number of dimensions (expected %d, got %d)",
32042 __Pyx_BufFmt_Init(&ctx, stack, dtype);
32043 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
32045 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
32046 PyErr_Format(PyExc_ValueError,
32047 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
32048 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
32050 (buf->itemsize > 1) ?
"s" :
"",
32053 (dtype->size > 1) ?
"s" :
"");
32056 if (buf->len > 0) {
32057 for (i = 0; i < ndim; i++) {
32058 spec = axes_specs[i];
32059 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
32061 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
32064 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
32067 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
32068 new_memview != NULL) == -1)) {
32074 Py_XDECREF(new_memview);
32077 __Pyx_RefNannyFinishContext();
32082 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj,
int writable_flag) {
32083 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32084 __Pyx_BufFmt_StackElem stack[1];
32085 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
32087 if (obj == Py_None) {
32088 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32091 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
32092 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32093 &__Pyx_TypeInfo_float, stack,
32095 if (unlikely(retcode == -1))
32099 result.memview = NULL;
32100 result.data = NULL;
32105 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *obj,
int writable_flag) {
32106 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32107 __Pyx_BufFmt_StackElem stack[1];
32108 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
32110 if (obj == Py_None) {
32111 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32114 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
32115 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32116 &__Pyx_TypeInfo_float, stack,
32118 if (unlikely(retcode == -1))
32122 result.memview = NULL;
32123 result.data = NULL;
32128 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj,
int writable_flag) {
32129 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32130 __Pyx_BufFmt_StackElem stack[1];
32131 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
32133 if (obj == Py_None) {
32134 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32137 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
32138 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32139 &__Pyx_TypeInfo_double, stack,
32141 if (unlikely(retcode == -1))
32145 result.memview = NULL;
32146 result.data = NULL;
32151 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj,
int writable_flag) {
32152 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32153 __Pyx_BufFmt_StackElem stack[1];
32154 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
32156 if (obj == Py_None) {
32157 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32160 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
32161 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32162 &__Pyx_TypeInfo_double, stack,
32164 if (unlikely(retcode == -1))
32168 result.memview = NULL;
32169 result.data = NULL;
32174 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *obj,
int writable_flag) {
32175 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32176 __Pyx_BufFmt_StackElem stack[1];
32177 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
32179 if (obj == Py_None) {
32180 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32183 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
32184 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32185 &__Pyx_TypeInfo_long__double, stack,
32187 if (unlikely(retcode == -1))
32191 result.memview = NULL;
32192 result.data = NULL;
32197 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *obj,
int writable_flag) {
32198 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32199 __Pyx_BufFmt_StackElem stack[1];
32200 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
32202 if (obj == Py_None) {
32203 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32206 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
32207 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32208 &__Pyx_TypeInfo_long__double, stack,
32210 if (unlikely(retcode == -1))
32214 result.memview = NULL;
32215 result.data = NULL;
32220 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj,
int writable_flag) {
32221 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32222 __Pyx_BufFmt_StackElem stack[1];
32223 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32225 if (obj == Py_None) {
32226 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32229 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32230 PyBUF_RECORDS_RO | writable_flag, 1,
32231 &__Pyx_TypeInfo_float, stack,
32233 if (unlikely(retcode == -1))
32237 result.memview = NULL;
32238 result.data = NULL;
32243 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj,
int writable_flag) {
32244 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32245 __Pyx_BufFmt_StackElem stack[1];
32246 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32248 if (obj == Py_None) {
32249 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32252 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32253 PyBUF_RECORDS_RO | writable_flag, 1,
32254 &__Pyx_TypeInfo_int, stack,
32256 if (unlikely(retcode == -1))
32260 result.memview = NULL;
32261 result.data = NULL;
32266 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
32267 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32268 __Pyx_BufFmt_StackElem stack[1];
32269 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32271 if (obj == Py_None) {
32272 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32275 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32276 PyBUF_RECORDS_RO | writable_flag, 1,
32277 &__Pyx_TypeInfo_double, stack,
32279 if (unlikely(retcode == -1))
32283 result.memview = NULL;
32284 result.data = NULL;
32289 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj,
int writable_flag) {
32290 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32291 __Pyx_BufFmt_StackElem stack[1];
32292 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32294 if (obj == Py_None) {
32295 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32298 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32299 PyBUF_RECORDS_RO | writable_flag, 1,
32300 &__Pyx_TypeInfo_long__double, stack,
32302 if (unlikely(retcode == -1))
32306 result.memview = NULL;
32307 result.data = NULL;
32312 static __Pyx_memviewslice
32313 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
32314 const char *mode,
int ndim,
32315 size_t sizeof_dtype,
int contig_flag,
32316 int dtype_is_object)
32318 __Pyx_RefNannyDeclarations
32320 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
32321 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
32322 Py_buffer *buf = &from_memview->view;
32323 PyObject *shape_tuple = NULL;
32324 PyObject *temp_int = NULL;
32325 struct __pyx_array_obj *array_obj = NULL;
32326 struct __pyx_memoryview_obj *memview_obj = NULL;
32327 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
32328 for (i = 0; i < ndim; i++) {
32329 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
32330 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
32331 "indirect dimensions (axis %d)", i);
32335 shape_tuple = PyTuple_New(ndim);
32336 if (unlikely(!shape_tuple)) {
32339 __Pyx_GOTREF(shape_tuple);
32340 for(i = 0; i < ndim; i++) {
32341 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
32342 if(unlikely(!temp_int)) {
32345 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
32349 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
32350 if (unlikely(!array_obj)) {
32353 __Pyx_GOTREF(array_obj);
32354 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
32355 (PyObject *) array_obj, contig_flag,
32357 from_mvs->memview->typeinfo);
32358 if (unlikely(!memview_obj))
32360 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
32362 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
32363 dtype_is_object) < 0))
32367 __Pyx_XDECREF(new_mvs.memview);
32368 new_mvs.memview = NULL;
32369 new_mvs.data = NULL;
32371 __Pyx_XDECREF(shape_tuple);
32372 __Pyx_XDECREF(temp_int);
32373 __Pyx_XDECREF(array_obj);
32374 __Pyx_RefNannyFinishContext();
32379 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
32380 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32381 #pragma GCC diagnostic push
32382 #pragma GCC diagnostic ignored "-Wconversion"
32384 const long neg_one = (long) -1, const_zero = (
long) 0;
32385 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32386 #pragma GCC diagnostic pop
32388 const int is_unsigned = neg_one > const_zero;
32390 if (
sizeof(
long) <
sizeof(long)) {
32391 return PyInt_FromLong((
long) value);
32392 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
32393 return PyLong_FromUnsignedLong((
unsigned long) value);
32394 #ifdef HAVE_LONG_LONG
32395 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
32396 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
32400 if (
sizeof(
long) <=
sizeof(
long)) {
32401 return PyInt_FromLong((
long) value);
32402 #ifdef HAVE_LONG_LONG
32403 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
32404 return PyLong_FromLongLong((PY_LONG_LONG) value);
32409 int one = 1;
int little = (int)*(
unsigned char *)&one;
32410 unsigned char *bytes = (
unsigned char *)&value;
32411 return _PyLong_FromByteArray(bytes,
sizeof(
long),
32412 little, !is_unsigned);
32417 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
32418 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32419 #pragma GCC diagnostic push
32420 #pragma GCC diagnostic ignored "-Wconversion"
32422 const int neg_one = (int) -1, const_zero = (
int) 0;
32423 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32424 #pragma GCC diagnostic pop
32426 const int is_unsigned = neg_one > const_zero;
32427 #if PY_MAJOR_VERSION < 3
32428 if (likely(PyInt_Check(x))) {
32429 if (
sizeof(
int) <
sizeof(long)) {
32430 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
32432 long val = PyInt_AS_LONG(x);
32433 if (is_unsigned && unlikely(val < 0)) {
32434 goto raise_neg_overflow;
32440 if (likely(PyLong_Check(x))) {
32442 #if CYTHON_USE_PYLONG_INTERNALS
32443 const digit* digits = ((PyLongObject*)x)->ob_digit;
32444 switch (Py_SIZE(x)) {
32445 case 0:
return (
int) 0;
32446 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
32448 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
32449 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
32450 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32451 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
32452 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
32457 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
32458 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
32459 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32460 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
32461 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32466 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
32467 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
32468 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32469 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
32470 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
32476 #if CYTHON_COMPILING_IN_CPYTHON
32477 if (unlikely(Py_SIZE(x) < 0)) {
32478 goto raise_neg_overflow;
32482 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32483 if (unlikely(result < 0))
32485 if (unlikely(result == 1))
32486 goto raise_neg_overflow;
32489 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
32490 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
32491 #ifdef HAVE_LONG_LONG
32492 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
32493 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32497 #if CYTHON_USE_PYLONG_INTERNALS
32498 const digit* digits = ((PyLongObject*)x)->ob_digit;
32499 switch (Py_SIZE(x)) {
32500 case 0:
return (
int) 0;
32501 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
32502 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
32504 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
32505 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
32506 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32507 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
32508 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
32513 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
32514 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
32515 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32516 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
32517 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
32522 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
32523 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
32524 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32525 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
32526 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32531 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
32532 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
32533 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32534 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
32535 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32540 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
32541 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
32542 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32543 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
32544 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
32549 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
32550 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
32551 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32552 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
32553 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
32559 if (
sizeof(
int) <=
sizeof(long)) {
32560 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
32561 #ifdef HAVE_LONG_LONG
32562 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
32563 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
32568 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
32569 PyErr_SetString(PyExc_RuntimeError,
32570 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
32573 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
32574 #if PY_MAJOR_VERSION < 3
32575 if (likely(v) && !PyLong_Check(v)) {
32577 v = PyNumber_Long(tmp);
32582 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
32583 unsigned char *bytes = (
unsigned char *)&val;
32584 int ret = _PyLong_AsByteArray((PyLongObject *)v,
32585 bytes,
sizeof(val),
32586 is_little, !is_unsigned);
32596 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
32597 if (!tmp)
return (
int) -1;
32598 val = __Pyx_PyInt_As_int(tmp);
32603 PyErr_SetString(PyExc_OverflowError,
32604 "value too large to convert to int");
32606 raise_neg_overflow:
32607 PyErr_SetString(PyExc_OverflowError,
32608 "can't convert negative value to int");
32613 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
32614 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32615 #pragma GCC diagnostic push
32616 #pragma GCC diagnostic ignored "-Wconversion"
32618 const long neg_one = (long) -1, const_zero = (
long) 0;
32619 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32620 #pragma GCC diagnostic pop
32622 const int is_unsigned = neg_one > const_zero;
32623 #if PY_MAJOR_VERSION < 3
32624 if (likely(PyInt_Check(x))) {
32625 if (
sizeof(
long) <
sizeof(long)) {
32626 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
32628 long val = PyInt_AS_LONG(x);
32629 if (is_unsigned && unlikely(val < 0)) {
32630 goto raise_neg_overflow;
32636 if (likely(PyLong_Check(x))) {
32638 #if CYTHON_USE_PYLONG_INTERNALS
32639 const digit* digits = ((PyLongObject*)x)->ob_digit;
32640 switch (Py_SIZE(x)) {
32641 case 0:
return (
long) 0;
32642 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
32644 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
32645 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
32646 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32647 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
32648 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
32653 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
32654 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
32655 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32656 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
32657 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
32662 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
32663 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
32664 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32665 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
32666 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
32672 #if CYTHON_COMPILING_IN_CPYTHON
32673 if (unlikely(Py_SIZE(x) < 0)) {
32674 goto raise_neg_overflow;
32678 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32679 if (unlikely(result < 0))
32681 if (unlikely(result == 1))
32682 goto raise_neg_overflow;
32685 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
32686 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
32687 #ifdef HAVE_LONG_LONG
32688 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
32689 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32693 #if CYTHON_USE_PYLONG_INTERNALS
32694 const digit* digits = ((PyLongObject*)x)->ob_digit;
32695 switch (Py_SIZE(x)) {
32696 case 0:
return (
long) 0;
32697 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
32698 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
32700 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
32701 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
32702 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32703 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
32704 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
32709 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
32710 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
32711 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32712 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
32713 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
32718 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
32719 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
32720 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32721 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
32722 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32727 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
32728 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
32729 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32730 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
32731 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32736 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
32737 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
32738 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32739 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
32740 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
32745 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
32746 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
32747 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32748 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
32749 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
32755 if (
sizeof(
long) <=
sizeof(long)) {
32756 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
32757 #ifdef HAVE_LONG_LONG
32758 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
32759 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
32764 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
32765 PyErr_SetString(PyExc_RuntimeError,
32766 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
32769 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
32770 #if PY_MAJOR_VERSION < 3
32771 if (likely(v) && !PyLong_Check(v)) {
32773 v = PyNumber_Long(tmp);
32778 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
32779 unsigned char *bytes = (
unsigned char *)&val;
32780 int ret = _PyLong_AsByteArray((PyLongObject *)v,
32781 bytes,
sizeof(val),
32782 is_little, !is_unsigned);
32792 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
32793 if (!tmp)
return (
long) -1;
32794 val = __Pyx_PyInt_As_long(tmp);
32799 PyErr_SetString(PyExc_OverflowError,
32800 "value too large to convert to long");
32802 raise_neg_overflow:
32803 PyErr_SetString(PyExc_OverflowError,
32804 "can't convert negative value to long");
32809 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
32810 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32811 #pragma GCC diagnostic push
32812 #pragma GCC diagnostic ignored "-Wconversion"
32814 const int neg_one = (int) -1, const_zero = (
int) 0;
32815 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32816 #pragma GCC diagnostic pop
32818 const int is_unsigned = neg_one > const_zero;
32820 if (
sizeof(
int) <
sizeof(long)) {
32821 return PyInt_FromLong((
long) value);
32822 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
32823 return PyLong_FromUnsignedLong((
unsigned long) value);
32824 #ifdef HAVE_LONG_LONG
32825 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
32826 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
32830 if (
sizeof(
int) <=
sizeof(
long)) {
32831 return PyInt_FromLong((
long) value);
32832 #ifdef HAVE_LONG_LONG
32833 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
32834 return PyLong_FromLongLong((PY_LONG_LONG) value);
32839 int one = 1;
int little = (int)*(
unsigned char *)&one;
32840 unsigned char *bytes = (
unsigned char *)&value;
32841 return _PyLong_FromByteArray(bytes,
sizeof(
int),
32842 little, !is_unsigned);
32847 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
32848 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32849 #pragma GCC diagnostic push
32850 #pragma GCC diagnostic ignored "-Wconversion"
32852 const char neg_one = (char) -1, const_zero = (
char) 0;
32853 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32854 #pragma GCC diagnostic pop
32856 const int is_unsigned = neg_one > const_zero;
32857 #if PY_MAJOR_VERSION < 3
32858 if (likely(PyInt_Check(x))) {
32859 if (
sizeof(
char) <
sizeof(long)) {
32860 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
32862 long val = PyInt_AS_LONG(x);
32863 if (is_unsigned && unlikely(val < 0)) {
32864 goto raise_neg_overflow;
32870 if (likely(PyLong_Check(x))) {
32872 #if CYTHON_USE_PYLONG_INTERNALS
32873 const digit* digits = ((PyLongObject*)x)->ob_digit;
32874 switch (Py_SIZE(x)) {
32875 case 0:
return (
char) 0;
32876 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
32878 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
32879 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
32880 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32881 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
32882 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
32887 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
32888 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
32889 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32890 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
32891 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
32896 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
32897 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
32898 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32899 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
32900 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
32906 #if CYTHON_COMPILING_IN_CPYTHON
32907 if (unlikely(Py_SIZE(x) < 0)) {
32908 goto raise_neg_overflow;
32912 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32913 if (unlikely(result < 0))
32915 if (unlikely(result == 1))
32916 goto raise_neg_overflow;
32919 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
32920 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
32921 #ifdef HAVE_LONG_LONG
32922 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
32923 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32927 #if CYTHON_USE_PYLONG_INTERNALS
32928 const digit* digits = ((PyLongObject*)x)->ob_digit;
32929 switch (Py_SIZE(x)) {
32930 case 0:
return (
char) 0;
32931 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
32932 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
32934 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
32935 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
32936 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32937 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
32938 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
32943 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
32944 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
32945 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32946 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
32947 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
32952 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
32953 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
32954 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32955 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
32956 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32961 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
32962 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
32963 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32964 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
32965 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32970 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
32971 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
32972 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32973 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
32974 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
32979 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
32980 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
32981 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32982 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
32983 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
32989 if (
sizeof(
char) <=
sizeof(long)) {
32990 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
32991 #ifdef HAVE_LONG_LONG
32992 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
32993 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
32998 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
32999 PyErr_SetString(PyExc_RuntimeError,
33000 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
33003 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
33004 #if PY_MAJOR_VERSION < 3
33005 if (likely(v) && !PyLong_Check(v)) {
33007 v = PyNumber_Long(tmp);
33012 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
33013 unsigned char *bytes = (
unsigned char *)&val;
33014 int ret = _PyLong_AsByteArray((PyLongObject *)v,
33015 bytes,
sizeof(val),
33016 is_little, !is_unsigned);
33026 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
33027 if (!tmp)
return (
char) -1;
33028 val = __Pyx_PyInt_As_char(tmp);
33033 PyErr_SetString(PyExc_OverflowError,
33034 "value too large to convert to char");
33036 raise_neg_overflow:
33037 PyErr_SetString(PyExc_OverflowError,
33038 "can't convert negative value to char");
33043 static int __Pyx_check_binary_version(
void) {
33044 char ctversion[4], rtversion[4];
33045 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
33046 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
33047 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
33049 PyOS_snprintf(message,
sizeof(message),
33050 "compiletime version %s of module '%.100s' "
33051 "does not match runtime version %s",
33052 ctversion, __Pyx_MODULE_NAME, rtversion);
33053 return PyErr_WarnEx(NULL, message, 1);
33059 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
33061 #if PY_MAJOR_VERSION < 3
33062 if (t->is_unicode) {
33063 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
33064 }
else if (t->intern) {
33065 *t->p = PyString_InternFromString(t->s);
33067 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
33070 if (t->is_unicode | t->is_str) {
33072 *t->p = PyUnicode_InternFromString(t->s);
33073 }
else if (t->encoding) {
33074 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
33076 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
33079 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
33084 if (PyObject_Hash(*t->p) == -1)
33091 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
33092 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
33094 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
33096 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
33098 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
33099 #if !CYTHON_PEP393_ENABLED
33100 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
33102 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
33103 if (!defenc)
return NULL;
33104 defenc_c = PyBytes_AS_STRING(defenc);
33105 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
33107 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
33109 for (c = defenc_c; c < end; c++) {
33110 if ((
unsigned char) (*c) >= 128) {
33111 PyUnicode_AsASCIIString(o);
33117 *length = PyBytes_GET_SIZE(defenc);
33121 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
33122 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
33123 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
33124 if (likely(PyUnicode_IS_ASCII(o))) {
33125 *length = PyUnicode_GET_LENGTH(o);
33126 return PyUnicode_AsUTF8(o);
33128 PyUnicode_AsASCIIString(o);
33132 return PyUnicode_AsUTF8AndSize(o, length);
33137 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
33138 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
33140 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
33141 __Pyx_sys_getdefaultencoding_not_ascii &&
33143 PyUnicode_Check(o)) {
33144 return __Pyx_PyUnicode_AsStringAndSize(o, length);
33147 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
33148 if (PyByteArray_Check(o)) {
33149 *length = PyByteArray_GET_SIZE(o);
33150 return PyByteArray_AS_STRING(o);
33155 int r = PyBytes_AsStringAndSize(o, &result, length);
33156 if (unlikely(r < 0)) {
33163 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
33164 int is_true = x == Py_True;
33165 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
33166 else return PyObject_IsTrue(x);
33168 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
33170 if (unlikely(!x))
return -1;
33171 retval = __Pyx_PyObject_IsTrue(x);
33175 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
33176 #if PY_MAJOR_VERSION >= 3
33177 if (PyLong_Check(result)) {
33178 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
33179 "__int__ returned non-int (type %.200s). "
33180 "The ability to return an instance of a strict subclass of int "
33181 "is deprecated, and may be removed in a future version of Python.",
33182 Py_TYPE(result)->tp_name)) {
33189 PyErr_Format(PyExc_TypeError,
33190 "__%.4s__ returned non-%.4s (type %.200s)",
33191 type_name, type_name, Py_TYPE(result)->tp_name);
33195 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
33196 #if CYTHON_USE_TYPE_SLOTS
33197 PyNumberMethods *m;
33199 const char *name = NULL;
33200 PyObject *res = NULL;
33201 #if PY_MAJOR_VERSION < 3
33202 if (likely(PyInt_Check(x) || PyLong_Check(x)))
33204 if (likely(PyLong_Check(x)))
33206 return __Pyx_NewRef(x);
33207 #if CYTHON_USE_TYPE_SLOTS
33208 m = Py_TYPE(x)->tp_as_number;
33209 #if PY_MAJOR_VERSION < 3
33210 if (m && m->nb_int) {
33212 res = m->nb_int(x);
33214 else if (m && m->nb_long) {
33216 res = m->nb_long(x);
33219 if (likely(m && m->nb_int)) {
33221 res = m->nb_int(x);
33225 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
33226 res = PyNumber_Int(x);
33230 #if PY_MAJOR_VERSION < 3
33231 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
33233 if (unlikely(!PyLong_CheckExact(res))) {
33235 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
33238 else if (!PyErr_Occurred()) {
33239 PyErr_SetString(PyExc_TypeError,
33240 "an integer is required");
33244 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
33247 #if PY_MAJOR_VERSION < 3
33248 if (likely(PyInt_CheckExact(b))) {
33249 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
33250 return PyInt_AS_LONG(b);
33252 return PyInt_AsSsize_t(b);
33255 if (likely(PyLong_CheckExact(b))) {
33256 #if CYTHON_USE_PYLONG_INTERNALS
33257 const digit* digits = ((PyLongObject*)b)->ob_digit;
33258 const Py_ssize_t size = Py_SIZE(b);
33259 if (likely(__Pyx_sst_abs(size) <= 1)) {
33260 ival = likely(size) ? digits[0] : 0;
33261 if (size == -1) ival = -ival;
33266 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
33267 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
33271 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
33272 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33276 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
33277 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33281 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
33282 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
33286 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
33287 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
33291 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
33292 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33298 return PyLong_AsSsize_t(b);
33300 x = PyNumber_Index(b);
33302 ival = PyInt_AsSsize_t(x);
33306 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
33307 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
33309 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
33310 return PyInt_FromSize_t(ival);
Base class for linear operators. This class serves as interface for all derived classes.